We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Magnification: problems with posXMouse and posYMouse

Thread ID:





103949 Jun 11,2012 10:40 AM Jun 13,2012 12:17 AM Windows Forms 4
Tags: Diagram
Blanca Calderon
Asked On June 11, 2012 10:40 AM


I have a toolbarItem that create a bitmapNode when I click on it. I need the posXMouse and the posYMouse of this bitmapNode to get the exact position in my diagram.

However when I use magnification (150% for example) and after that I create a bitmapNode, the posX-YMouse are incorrect. Could you help me?

Thanks in advanced




Blanca Calderon
Replied On June 11, 2012 10:48 AM

Sorry, posXMouse and posYMouse represent MouseEventArgs.X and MouseEventArgs.Y



Amsath Ali M [Syncfusion]
Replied On June 12, 2012 01:33 AM

Hi Blanca,
Thanks for your interest in Syncfusion products.
We suggest you to use the Diagram.Controller’s ‘ConvertToModelCoordinates’ method to achieve your requirement. Please refer the below code snippet.
Here is the code:
  PointF locn = diagram1.Controller.ConvertToModelCoordinates(mousePos);          
            Bitmap bmp = new Bitmap(@"..//..//Lighthouse.jpg");
            BitmapNode bmpnode = new BitmapNode(bmp,new RectangleF(locn,new SizeF(100,100)));
Please try the above sample and let us know if you have any queries.
Amsath Ali. M


Blanca Calderon
Replied On June 12, 2012 09:20 AM

Thank you very much, it works great!!

Best regards,



Amsath Ali M [Syncfusion]
Replied On June 13, 2012 12:17 AM

Hi Blanca,


Thanks for the update.


Please let us know if you require any further assistance. We would be happy to help you out.



Amsath Ali. M


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.