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

PointToScreen from within a Shape

Thread ID:





42053 Mar 17,2006 07:57 PM UTC Mar 24,2006 04:41 AM UTC WinForms 1
Tags: Diagram
Eric Robishaw
Asked On March 17, 2006 07:57 PM UTC

How can I determine the point to screen coordinates of a shape''s location from within a shape''s class? If I could get access to the shapes Diagram container, then I could use it''s PointToScreen() method, but I don''t see a way to find the Diagram container that the shape is drawn on, from within the shape class itself. Parent only returns the nodes parent node. I thought Layer might be promising, but the Layer object evidently doesn''t know anything about its container either. Maybe there''s a better approach... but what I''m trying to do is place a form on screen, next to the Shape object. The shape object itself is responsible for displaying the form, and placing it next to itself. It also moves the form, when it moves, by overriding the Draw() method, looks at it''s location, and, if it moved since the last Draw() call, it moves the form. However, in order to do this, I need to be able to translate my Location into absolute Screen coordinates, and I have no methods to do this. Any Ideas?

Administrator [Syncfusion]
Replied On March 24, 2006 04:41 AM UTC

Hi, Basically Essential Diagram uses three coordinate systems - WorldCoordinates,View Coordinates and DeviceCoordinates. -The world coordinate system defines coordinates in terms that are useful to the application and meaningful to the end user. The unit of measurement for world coordinates can be pixels, inches, millimeters, or points and depends on the application. -The device coordinate space defines coordinates in terms of output devices like computer screens and printers. The unit of measurement for coordinates is pixels and the origin is defined to be the upper-left hand corner of the drawing surface. -The view coordinate system maps world coordinates onto a viewing area. There are standard methods available to make the convertions among the Coordinate systems like ViewToDevice(),DeviceToView(),ViewToWorld().. Kindly refer the Essential Online Documentation and the Help Documentation which would give you an idea about how to go with this. Regards, Praveena.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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