Page 1 of 1

Panning a view

Posted: 02 Jun 2007, 09:55
by aby
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

Posted: 06 Jun 2007, 15:12
by support
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

Posted: 06 Jun 2007, 18:39
by support
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