在图形上先输出文字,再打印,这种打印结果很不理想,字体模糊难以分辨;---直接看图片也是一样,更不用说打印了.所以只好在Printer上直接输出,问题来了,在Printer.EndDoc前;我想得到我在Printer.Canvas上绘画的东西如何做????代码如下:tmpbmp为位图对象; tmpbmp.Width:=864;
tmpbmp.Height:=1296; //BitBlt(tmpbmp.Canvas.Handle, 0, tmpbmp.Height, Printer.PageWidth ,Printer.PageHeight ,Printer.Canvas.Handle, 0, 0, SRCCOPY);
//StretchBlt(tmpbmp.Canvas.Handle,0,0,tmpbmp.Width,tmpbmp.Height,Printer.Canvas.Handle,0,0,Printer.PageWidth,Printer.PageHeight,SRCCOPY);
tmpbmp.Canvas.CopyRect(Rect(0,0,tmpbmp.Width,tmpbmp.Height),Printer.Canvas,Rect(0,0,Printer.PageWidth,Printer.PageHeight));
tmpbmp.SaveToFile('d:\testbmp.bmp');tmpbmp得到的只是空白
tmpbmp.Height:=1296; //BitBlt(tmpbmp.Canvas.Handle, 0, tmpbmp.Height, Printer.PageWidth ,Printer.PageHeight ,Printer.Canvas.Handle, 0, 0, SRCCOPY);
//StretchBlt(tmpbmp.Canvas.Handle,0,0,tmpbmp.Width,tmpbmp.Height,Printer.Canvas.Handle,0,0,Printer.PageWidth,Printer.PageHeight,SRCCOPY);
tmpbmp.Canvas.CopyRect(Rect(0,0,tmpbmp.Width,tmpbmp.Height),Printer.Canvas,Rect(0,0,Printer.PageWidth,Printer.PageHeight));
tmpbmp.SaveToFile('d:\testbmp.bmp');tmpbmp得到的只是空白
int OldMode=SetMapMode(prt->Handle,MM_ISOTROPIC);
SetWindowExtEx(prt->Handle,Screen->Width ,Screen->Height ,0);
SetViewportExtEx(prt->Handle,
Screen->Width*GetDeviceCaps(prt->Handle,LOGPIXELSX)/Screen->PixelsPerInch,
Screen->Height*GetDeviceCaps(prt->Handle,LOGPIXELSY)/Screen->PixelsPerInch,0);.......
.......prt->EndDoc();
SetMapMode(prt->Handle,OldMode);