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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 CustomHint
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

bmesser

United Kingdom
221 Posts

Posted - Nov 21 2017 :  10:05:20  Show Profile  Reply
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.

xequte

38182 Posts

Posted - Nov 21 2017 :  20:30:26  Show Profile  Reply
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
Go to Top of Page

bmesser

United Kingdom
221 Posts

Posted - Nov 22 2017 :  03:09:23  Show Profile  Reply
Thanks Nigel, that's very useful.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: