AddScaledDXFEx example

TsgCADImage  

  Examples >

AddScaledDXFEx example

TsgCADImage  

Previous pageReturn to chapter overviewNext page

The following code describes how to add a scaled CAD file into the current TsgCADImage class object:

 

TMyApp = class(TForm)

...

private

...

  FsgPaintBox: TsgDrawingNavigator;

...

public

...

  property sgPaintBox: TsgDrawingNavigator read FsgPaintBox;

...

end;

 

procedure TMyApp.AddCADImageClick(Sender: TObject);

var

  Img, Img2: TsgCADImage;

  APos, AScale: TFPoint;

begin

  bUseSHXFonts := True;

  sgPaintBox.LoadFromFile('c:\test.dxf');

  Img := TsgCADImage(sgPaintBox.Picture.Graphic);

  Img2 := TsgCADdxfImage.Create;

  Img2.LoadFromFile('c:\test_2.dxf');

  APos := MakeFPoint(000);

  AScale := MakeFPoint(1.01.01.0);

  Img.AddScaledDXFEx(Img2, 'VPort.dxf', APos, AScale, 45.0);

  Img.GetExtents;

  sgPaintBox.FitToSize;

end;

Go to CAD VCL Enterprise