大致能实现要求
不会在内存操作图像,用了一个图片框周转了一下
VB code
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 Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
Private Sub Command2_Click()
Dim nW As Long, nH As Long
nW = form1.Width / Screen.TwipsPerPixelX
nH = form1.Height / Screen.TwipsPerPixelY
BitBlt Picture1.hDC, 0, 0, nW, nH, GetDC(form11.hwnd), 0, 0, SRCCOPY Printer.ScaleLeft = 0
Printer.CurrentX = 0
Printer.PaintPicture Picture1.Image, 0, 0, Printer.Width, form11.Height * (Printer.Width / form11.Width), 0, 0, form11.Width, form11.Height Printer.EndDoc
End Sub
Private Sub Form_Load()
Picture1.Visible = False Picture1.BorderStyle = 0 Picture1.Width = form11.Width Picture1.Height = form11.Height Picture1.AutoRedraw = True
End Sub