Display image with real dimension
Moderators: SDS, support, admin
Display image with real dimension
I am evaluating the CADImport functions prior to purchase.
I want to open the file with format DWG, then view on the screen of Delphi in a component TImage or TsgImage, <font color="red">but with the dimension of image, as in the example View, click on the button btnIsWithoutBorder</font id="red">, then I want to save this image in a file bitmap *.bmp.
Can someone tell me what I need to do?
Thanks and best regards
Lingli
Lingli
I want to open the file with format DWG, then view on the screen of Delphi in a component TImage or TsgImage, <font color="red">but with the dimension of image, as in the example View, click on the button btnIsWithoutBorder</font id="red">, then I want to save this image in a file bitmap *.bmp.
Can someone tell me what I need to do?
Thanks and best regards
Lingli
Lingli
Dear Lingli,
Please use the following construction:
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Please use the following construction:
Code: Select all
<b>uses</b>
... SGImage, DWG, SGExport;
<b>type</b>
TForm1 = <b>class</b>(TForm)
...
<b>private</b>
Img: TsgDWGImage;
...
<b>implementation</b>
<font color="green">{$R *.dfm}</font id="green">
<b>procedure</b> TForm1.btnForum_328Click(Sender: TObject);
<b>var</b>
E: TsgExport;
<b>begin</b>
sgImage1.LoadFromFile(<font color="blue">'c:\test.dwg'</font id="blue">);
<b>if</b> sgImage1.Picture.Graphic <b>is</b> TsgDWGImage <b>then
begin</b>
sgImage1.Align := alClient;
Img := TsgDWGImage(sgImage1.Picture.Graphic);
<b>end
else
begin</b>
Img := <b>nil</b>;
Exit;
<b>end</b>;
sgImage1.ChangeScale(True, 1, sgImage1.Center);
Img.IsWithoutBorder := True;
E := TsgExport.Create;
<b>try</b>
E.ExportTo(sgImage1.Picture.Graphic,
<font color="blue">'c:\test.bmp'</font id="blue">,
xpBitmap,
sgImage1.Width,
sgImage1.Height);
<b>finally</b>
E.Free;
<b>end</b>;
<b>end</b>;
please post questions to the forum or write to support@cadsofttools.com