打印图片框?谢了!该怎么处理
打印图片框??谢了!!
是这样的.我想点 "打印 "这个按钮的时候.就可以打印Picture1这个控件里的内容??不知道怎么实现了.谢谢了.
------解决方案--------------------
Option Explicit
Private Declare Function BitBlt Lib "gdi32 " (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
Private Sub Command1_Click()
Picture1.Width = Picture1.Width
Picture1.Height = Picture1.Height
Picture1.AutoRedraw = True
BitBlt Picture1.hDC, 0, 0, Picture1.Width / Screen.TwipsPerPixelX, Picture1.Height / Screen.TwipsPerPixelY, Picture1.hDC, 0, 0, SRCCOPY
Picture1.AutoRedraw = False
Picture1.Refresh
Printer.PaintPicture Picture1.Image, 1000, 1000
Printer.EndDoc
End Sub
是这样的.我想点 "打印 "这个按钮的时候.就可以打印Picture1这个控件里的内容??不知道怎么实现了.谢谢了.
------解决方案--------------------
Option Explicit
Private Declare Function BitBlt Lib "gdi32 " (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
Private Sub Command1_Click()
Picture1.Width = Picture1.Width
Picture1.Height = Picture1.Height
Picture1.AutoRedraw = True
BitBlt Picture1.hDC, 0, 0, Picture1.Width / Screen.TwipsPerPixelX, Picture1.Height / Screen.TwipsPerPixelY, Picture1.hDC, 0, 0, SRCCOPY
Picture1.AutoRedraw = False
Picture1.Refresh
Printer.PaintPicture Picture1.Image, 1000, 1000
Printer.EndDoc
End Sub