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. Image for the cookie policy date
close icon

Magnification: problems with posXMouse and posYMouse

Hello,

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

 

 

 


4 Replies

BC Blanca Calderon June 11, 2012 02:48 PM UTC

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

Thanks!

 



AA Amsath Ali M Syncfusion Team June 12, 2012 05:33 AM UTC

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:
[C#]
  PointF locn = diagram1.Controller.ConvertToModelCoordinates(mousePos);          
            Bitmap bmp = new Bitmap(@"..//..//Lighthouse.jpg");
            BitmapNode bmpnode = new BitmapNode(bmp,new RectangleF(locn,new SizeF(100,100)));
            diagram1.Model.AppendChild(bmpnode);
 
 
Please try the above sample and let us know if you have any queries.
Regards,
Amsath Ali. M


F103949_85be10b0.zip


BC Blanca Calderon June 12, 2012 01:20 PM UTC

Thank you very much, it works great!!

Best regards,

    Blanca

 



AA Amsath Ali M Syncfusion Team June 13, 2012 04:17 AM UTC

Hi Blanca,

 

Thanks for the update.

 

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

 

Regards,

Amsath Ali. M


Loader.
Live Chat Icon For mobile
Up arrow icon