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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Magnification: problems with posXMouse and posYMouse

Thread ID:

Created:

Updated:

Platform:

Replies:

103949 Jun 11,2012 02:40 PM UTC Jun 13,2012 04:17 AM UTC WinForms 4
loading
Tags: Diagram
Blanca Calderon
Asked On June 11, 2012 02:40 PM UTC

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

 

 

 


Blanca Calderon
Replied On June 11, 2012 02:48 PM UTC

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

Thanks!

 


Amsath Ali M [Syncfusion]
Replied On 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

Blanca Calderon
Replied On June 12, 2012 01:20 PM UTC

Thank you very much, it works great!!

Best regards,

    Blanca

 


Amsath Ali M [Syncfusion]
Replied On 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


CONFIRMATION

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.

Warning Icon 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.Close Icon

;