回复 30楼 radiofan
用GDI+ api 创建图形句柄,封装ReportListener重载OutputPage,在OutputPage里面处理生成图片文件,这样应该可以改变图片的分辨率。试试写个简单示例参考
[此贴子已经被作者于2019-8-2 16:47编辑过]
*** test.prg *** CLEAR #DEFIN PixelFormat32bppARGB 0x26200A DECLARE LONG GdipCreateBitmapFromScan0 IN gdiplus.dll LONG, LONG, LONG, LONG, STRING@, LONG@ DECLARE LONG GdipGetImageGraphicsContext IN gdiplus.dll LONG, LONG@ DECLARE LONG GdipSaveImageToFile IN gdiplus.dll LONG, STRING@, STRING@, LONG DECLARE LONG GdipDisposeImage IN gdiplus.dll LONG DECLARE LONG GdipDeleteGraphics IN gdiplus.dll LONG oRL = CREATEOBJECT("ReportListener") oRL.ListenerType = 3 REPORT FORM ? OBJECT oRL for aa = 1 to oRL.PageTotal LOCAL nWidth, nHeight, hBitmap, hGraphics, cFile, bmpGUID nWidth = oRL.GetPageWidth()/4 nHeight = oRL.GetPageHeight()/4 && 分辨率太大图片好象有点不正常,情况不明。 hBitmap = 0 GdipCreateBitmapFromScan0(nWidth, nHeight, 0, PixelFormat32bppARGB, 0, @hBitmap) IF hBitmap == 0 ? "创建Bitmap失败" RETURN ENDIF hGraphics = 0 GdipGetImageGraphicsContext(hBitmap, @hGraphics) IF hGraphics == 0 GdipDisposeImage(hBitmap) ? "获取Graphics失败" RETURN ENDIF oRL.OutputPage(aa, hGraphics, 1, 0,0,nWidth,nHeight, 0,0,nWidth,nHeight) cFile = "D:\temp\kkkk" + alltrim(str(aa)) + ".png" bmpGUID = 0h06F47C55041AD3119A730000F81EF32E GdipSaveImageToFile(hBitmap, STRCONV(cFile+0h00,5),@bmpGUID,0) GdipDisposeImage(hBitmap) GdipDeleteGraphics(hGraphics) endfor