我想居中打印一位图, 在一打印机上打印正确, 但是在另一台打印机上却有偏差, 代码如下:
‘ Widht, Height 为打印的位图的大小
X = (Printer.Width - Width) / 2
Y = (Printer.Height - Height) / 2
'位图送打印机
StretchBlt Printer.hdc, X \ Printer.TwipsPerPixelX, Y \ Printer.TwipsPerPixelY,
Width \ Printer.TwipsPerPixelX, Height \ Printer.TwipsPerPixelY,tempDC, 0, 0, Width \ Screen.TwipsPerPixelX, Height \ Screen.TwipsPerPixelY, &HCC0020
请问, 发生上面两种不同情形的可能因素有哪些啊? 谢谢指教!!!!
‘ Widht, Height 为打印的位图的大小
X = (Printer.Width - Width) / 2
Y = (Printer.Height - Height) / 2
'位图送打印机
StretchBlt Printer.hdc, X \ Printer.TwipsPerPixelX, Y \ Printer.TwipsPerPixelY,
Width \ Printer.TwipsPerPixelX, Height \ Printer.TwipsPerPixelY,tempDC, 0, 0, Width \ Screen.TwipsPerPixelX, Height \ Screen.TwipsPerPixelY, &HCC0020
请问, 发生上面两种不同情形的可能因素有哪些啊? 谢谢指教!!!!
Printer.Height 你没有设置上面两个属性的值
通过设置上面两个属性值来定置纸张尺寸
在函数里定置打印图形的大小
2、StretchBlt 按象素打印,大小与该打印机的分辨率有关Printer.TwipsPerPixelX、Y