Send Tsgimage picture To QrImage

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
bigredinf
Posts: 5
Joined: 24 Jun 2006, 10:37
Location: Taiwan

Send Tsgimage picture To QrImage

Post by bigredinf » 05 Jul 2006, 10: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>;

support
Posts: 3256
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 05 Jul 2006, 12: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

bigredinf
Posts: 5
Joined: 24 Jun 2006, 10:37
Location: Taiwan

Post by bigredinf » 05 Jul 2006, 15: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, 10:37
Location: Taiwan

Post by bigredinf » 05 Jul 2006, 15:38

By the way, I uses D7pro.

support
Posts: 3256
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 05 Jul 2006, 16: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

bigredinf
Posts: 5
Joined: 24 Jun 2006, 10:37
Location: Taiwan

Post by bigredinf » 06 Jul 2006, 05:41

Thank you a lot.
It work great.


Kadee/Bigredinf

Post Reply