Rotate a drawing

  Examples >

Rotate a drawing

Previous pageReturn to chapter overviewNext page

The following example demonstrates how to rotate a drawing 180 degrees.

 

procedure TForm1.RotateDrawingClick(Sender: TObject);
var
  vDrawing: TsgCADImage;
begin
  vDrawing := TsgCADDXFImage.Create;
  vDrawing.LoadFromFile('Entities.dxf');
  vDrawing.Rotate(axisZ, 90); // rotate 90%
  vDrawing.GetExtents; // recalculate the extents of the drawing
  Image1.Canvas.StretchDraw(Rect(0, 0,
    Round(vDrawing.Width * Image1.Height / vDrawing.Height), Image1.Height), vDrawing);
  vDrawing.Free;
end;

 

Without rotation

bm2

Rotated 180 degrees

bm3

Go to CAD VCL Enterprise