ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 CustomHint

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bmesser Posted - Nov 21 2017 : 10:05:20
Hi

Out of curiosity I was just wondering how you would go about attaching some code to the Customhint property in an ImageEnView component. I know that the component can display hints because there's a Showhint property, but wondered how you could add your own hints?

Bruce.
2   L A T E S T    R E P L I E S    (Newest First)
bmesser Posted - Nov 22 2017 : 03:09:23
Thanks Nigel, that's very useful.
xequte Posted - Nov 21 2017 : 20:30:26
Hi Bruce

You have two options.

Firstly, you can disable EnableInteractionHints, and then handle hints like any standard TControl:

https://www.imageen.com/help/TImageEnView.EnableInteractionHints.html

Secondly, you can use the EnableInteractionHints functionality by specifying your own hints, using SetInteractionHint:

https://www.imageen.com/help/TImageEnView.SetInteractionHint.html


// display current position in pixels
procedure TForm1.ImageEnVect1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
  xx, yy: integer;
begin
  xx := ImageEnView1.XScr2Bmp(X);
  yy := ImageEnView1.yscr2bmp(Y);
  if (xx >= 0) and (xx < ImageEnView1.IEBitmap.Width) and (yy >= 0) and (yy < ImageEnView1.IEBitmap.Height) then
  begin
    ImageEnView1.SetInteractionHint(Format('%d %d', [xx, yy]), X, Y, '0000 0000');
    ImageEnView1.Paint();
  end;
end;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com