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
 Extended cursor
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

graphman

259 Posts

Posted - May 14 2014 :  09:32:54  Show Profile  Reply
Is there a way to show cursor like in the attached image?

xequte

38514 Posts

Posted - May 14 2014 :  13:44:24  Show Profile  Reply
Hi

Yes, you could do it quite easily by overriding the TImageEnView draw event:

http://www.imageen.com/help/TIEOnDrawCanvas.html

Get the cursor position...
pt := ImageEnView1.ScreenToClient( Mouse.CursorPos );

And then fire off two canvas.LineTo calls with the relevant pen.style

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

graphman

259 Posts

Posted - May 15 2014 :  01:10:34  Show Profile  Reply
Thanks
Go to Top of Page

graphman

259 Posts

Posted - May 15 2014 :  12:49:18  Show Profile  Reply
But I see these lines at starting of program only.
Nothing happen at mouse moving.



void __fastcall TForm9::ImageEnView1DrawCanvas(TObject *Sender, TCanvas *ACanvas,
TRect &ARect)
{
TPoint pt = ImageEnView1->ScreenToClient(Mouse->CursorPos);

ACanvas->Pen->Style = psDot;

ACanvas->MoveTo(0, pt.y);
ACanvas->LineTo(ImageEnView1->Width, pt.y);

ACanvas->MoveTo(pt.x, 0);
ACanvas->LineTo(pt.x, ImageEnView1->Height);
}
//---------------------------------------------------------------------------
Go to Top of Page

spetric

Croatia
308 Posts

Posted - May 15 2014 :  15:17:35  Show Profile  Reply
I think it's more convenient to use two perpendicular iekLine objects
and move them in OnMouseMove event.
Go to Top of Page

xequte

38514 Posts

Posted - May 16 2014 :  01:42:10  Show Profile  Reply
You would need to invalidate the ImageEnView to repaint it (or at least repaint the portion that previously had a a line drawn).

But spetric may be right, it might be better to use external controls to handle it so that you do not get excessive redraw.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

graphman

259 Posts

Posted - May 16 2014 :  02:19:53  Show Profile  Reply
OK
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: