VB打印form的缩放问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 03:59:55
怎样在打印form的时候扩大图片,达到A4纸的大小?

给你个例子。

先剪贴到剪贴板中,在转成picture,再打印

Private Const HORZRES = 8 ' Horizontal width in pixels
Private Const VERTRES = 10 ' Vertical width in pixels
Private Const CF_BITMAP = 2
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source

Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function BitBlt Lib "gdi32