Board index » cppbuilder » Image->Canvas don't print.
Cristian
![]() CBuilder Developer |
Mon, 17 Jun 2002 03:00:00 GMT
Image->Canvas don't print.
I work with BCB 1.0.
In my form there is a TPrintDialog and a TImage. When I try to print using Image1->Canvas my prog don't work, but when I print with the form canvas it work. Why? This is my simple prog: //--------------------------------------------------------------- #include <printers.hpp> // Deleting next line don't print! Quote} void __fastcall TForm1::FormPaint(TObject *Sender) { cnv->Rectangle(10,30,290,150); Quote} void __fastcall TForm1::Button1Click(TObject *Sender) { if(PrintDialog1->Execute()) { Printer()->BeginDoc(); StretchBlt( Printer()->Handle,// handle of destination device context 100, // x-coordinate of upper-left corner of dest. rect. 100, // y-coordinate of upper-left corner of dest. rect. 900, // width of destination rectangle 900, // height of destination rectangle cnv->Handle, // handle of source device context 0, // x-coordinate of upper-left corner of source rectangle 0, // y-coordinate of upper-left corner of source rectangle Image1->Width, // width of source rectangle Image1->Height,// height of source rectangle SRCCOPY // raster operation code ); Printer()->EndDoc(); } Quote} |