Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Centering a mouse cursor over the center of a rasterImageViewer
Started by leftback at 06-12-2008 8:23. Topic has 2 replies.

Print Search « Previous Thread Next Thread »
  06-12-2008, 8:23
leftback is not online. Last active: 4/10/2008 9:02:37 AM leftback

Top 50 Posts
Joined on 03-14-2008
Posts 35
Centering a mouse cursor over the center of a rasterImageViewer
Reply Quote
Using c#,wpf and version 15

is there a way to do this in a wpf app hosting a forms control that hosts the rasterviewer??

Thanks
   Report 
  06-12-2008, 15:36
GregR is not online. Last active: 9/30/2008 12:26:32 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,607
Re: Centering a mouse cursor over the center of a rasterImageViewer
Reply Quote
LEADTOOLS doesn't have anything to move the mouse cursor.  You will need to declare and use the API function SetCursorPos and ClientToScreen.

I've never tried it in WPF, but I would imagine you can get the client coordinates of the RasterImageViewer relative to the WPF form and then do the math and pass the correct point.  There might be a better way to do this as far as doing the math to get the point you want, but it's more of a Windows API/WPF API issue.  If you have any more questions regarding this you should contact Microsoft. 

Here's an example of how to declare those API functions and center the cursor on a button.

http://swigartconsulting.blogs.com/tech_blender/2005/08/how_to_move_the.html

Greg Ross
LEADTOOLS Technical Support
   Report 
  06-13-2008, 4:01
leftback is not online. Last active: 4/10/2008 9:02:37 AM leftback

Top 50 Posts
Joined on 03-14-2008
Posts 35
Re: Centering a mouse cursor over the center of a rasterImageViewer
Reply Quote
Thats brilliant thanks, yeah I was already thinkng of using API stuff for the mouse cursor but it was the client coordinates of the RasterImageViewer that I had overlooked.

Cheers!!
   Report 
Post
LEAD Support Fo... » Developer » DotNet » Re: Centering a mouse cursor over the center of a rasterImageViewer

Powered by Community Server, by Telligent Systems