Send Tsgimage picture To QrImage

If you have any comments or questions about our developing tools, please do not hesitate to contact us at this forum

Moderators: admin, SDS, support

Send Tsgimage picture To QrImage

Postby bigredinf » 05 Jul 2006, 07:25

I can load a dxf file to a tsgimage and show on my
delphi form.
Now I need to send this Tsgimage.picture to
a Qrimage in Quickreport and preview the
report,how can I do?

I use follow code with no luck.Please help!
Code: Select all
<b>var</b>
  vImg: TsgDXFImage;
  StmImg: TMemoryStream;
<b>begin</b>
  StmImg := TMemoryStream.Create;
  <b>try</b>
    vImg := TsgDXFImage(sgPaintBox.Picture.Graphic);
    vImg.SaveToStream(StmImg);
    QRImage1.Picture.Graphic.LoadFromStream(StmImg);
    <font color="red">//this line got a AV</font id="red">
    QuickRep1.preview;
  <b>finally</b>
    StmImg.Free;
  <b>end</b>;
bigredinf
 
Posts: 5
Joined: 24 Jun 2006, 07:37
Location: Taiwan

Postby support » 05 Jul 2006, 09:36

Hello,

Thank you for the question. Please try the following construction:
Code: Select all
<b>var</b>
  vBMP: TBitmap;
<b>begin</b>
   vBMP := TBitmap.Create;
   vBMP.SetBounds(0,0,800,600);
   vImg := TsgDXFImage(sgPaintBox.Picture.Graphic);
   vBMP.Canvas.StretchDraw(vBMP.Bounds, vImg);
    QRImage1.Picture.Graphic := vBMP
   .....

It is incorrect to give DXF data to QReport. It will not recognize it.

Sergey.

please post questions to the forum or write to support@cadsofttools.com
support
 
Posts: 2226
Joined: 30 Mar 2005, 08:36
Location: Russia

Postby bigredinf » 05 Jul 2006, 12:35

Dear Sergey,

Thanks for your quick reply.
but follow code:

vBMP.setBounds(0,0,800,600);
vBMP.Canvas.StretchDraw(vBMP.Bounds, vImg);

[Error] PcWkEditCK.pas(823): Undeclared identifier: 'setBounds'
[Error] PcWkEditCK.pas(826): Undeclared identifier: 'Bounds'


Rregards,

Kadee/bigredinf
bigredinf
 
Posts: 5
Joined: 24 Jun 2006, 07:37
Location: Taiwan

Postby bigredinf » 05 Jul 2006, 12:38

By the way, I uses D7pro.
bigredinf
 
Posts: 5
Joined: 24 Jun 2006, 07:37
Location: Taiwan

Postby support » 05 Jul 2006, 13:38

Sorry for the mess.
Please use like the following:

QRImage1.Picture.Graphic := sgPaintBox.Picture.Graphic

Sergey.


please post questions to the forum or write to support@cadsofttools.com
support
 
Posts: 2226
Joined: 30 Mar 2005, 08:36
Location: Russia

Postby bigredinf » 06 Jul 2006, 02:41

Thank you a lot.
It work great.


Kadee/Bigredinf
bigredinf
 
Posts: 5
Joined: 24 Jun 2006, 07:37
Location: Taiwan


Return to CADImportVCL + DXFExportVCL

Who is online

Users browsing this forum: Bing [Bot] and 1 guest