Relative postion

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
archna
Posts: 5
Joined: 21 Oct 2010, 16:47

Relative postion

Post by archna » 27 Oct 2010, 14:43

Hi,

We haved added picture boxes to the cad picture box control after loading the floor plan to show our entities.The Problem is we need to change the relative position of picture boxes
when we zoom in and Zoom out.

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Relative postion

Post by support » 01 Nov 2010, 15:16

Hello.
Unfortunately I'm not sure I understood correctly your task. If you need move one or more PictureBox/CADPictureBox objects on form then please set CADPictureBox.Location or PictureBox.Location. This property can be set after zoom operation.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

archna
Posts: 5
Joined: 21 Oct 2010, 16:47

Re: Relative postion

Post by archna » 01 Nov 2010, 15:44

Hi,

I need to set the new top and left for the picture box. The problem is i am not getting the coordinates. e.g I placed the picture box (.NET control) on mouse click on 120,430 . When I Zoom in or Zoom out how I can get the corresponding position in the new scale.

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Relative postion

Post by support » 03 Nov 2010, 17:04

Hello.
Zoom functionality changes CADImage and screen points correspondence. If you need PictureBox (added to CADPictureBox) control fixed on screen then you don't need any additional code. Reversed situation if you want move PictureBox on screen to provide PictureBox top/left point correspondence to some fixed point on drawing. In that case you need transform two-dimensional screen coordinates to three-dimensional CAD coordinates then reconversion after zoom.
You can transform a two-dimensional screen point into three-dimensional CAD point using CADConst.GetRealPoint method. Reverse conversion can be fulfiled using CADImage.GetPoint method. Please see example in Viewer demo application.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply