1,216
社区成员
发帖
与我相关
我的任务
分享
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
Private Sub Form_Load()
Picture1.AutoRedraw = True
Picture1.Line (1, 1)-(4500, 1500), RGB(0, 0, 0), BF
Picture1.CurrentX = 200
Picture1.CurrentY = 200
Picture1.FontBold = True
Picture1.FontName = "宋体"
Picture1.FontSize = 48
Picture1.ForeColor = RGB(255, 255, 255)
Picture1.FontTransparent = True
Picture1.Print "黑底白字"
End Sub