Panning a view

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
aby
Posts: 81
Joined: 21 May 2007, 13:02
Location: Turkey

Panning a view

Post by aby » 02 Jun 2007, 09:55

Hi,

There is a Scale command which is scaling the drawing but not a Pan command( I couldn't find it in the help). How can I pan the zoomed drawing from one point to another.

Thanks

Aby

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

Post by support » 06 Jun 2007, 15:12

Hello!

The following code is based on <b>Template</b> demo. It is available at: http://www.cadsofttools.com/download/Template.zip

Code: Select all

<b>procedure</b> TForm1.btnMoveClick(Sender: TObject);
<b>var</b>
  vPoint: TPoint;
  vFPoint: TFPoint;
  vScale: double;
<b>begin</b>
  vPoint := sgPaintBox.Center;
  vFPoint := sgPaintBox.GetDrawingInternalCoordsWithoutSnap(vPoint.X + <font color="blue">10</font id="blue">, vPoint.Y + <font color="blue">10</font id="blue">);
  vScale := sgPaintBox.Scale;
  sgPaintBox.ShowPoint(vFPoint, vScale);
  sgPaintBox.Invalidate;
<b>end</b>;
Sergey.

Please post questions to the forum or write to support@cadsofttools.com

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

Post by support » 06 Jun 2007, 18:39

BTW: <b>CAD Import VCL</b> v.6.2 will include new procedure:

Code: Select all

<b>unit</b> SGDrawingNavigator;
TSGDrawingNavigator = <b>class</b> (...)
...
<b>procedure</b> MovePictureRect(Dx, Dy: Integer);
...
This procedure will let to manage without previous code.
<br />
We will inform you when new version of the library will be released.

Sergey.


Please post questions to the forum or write to support@cadsofttools.com

Post Reply