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:

Created:

Updated:

Platform:

Replies:

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

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 10:48 AM

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

Thanks!

 


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:
[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 09:20 AM

Thank you very much, it works great!!

Best regards,

    Blanca

 


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.

 

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.

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.

;