Private Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Dim SaveMode As Integer SaveMode = Pic.ScaleMode Shape1.BorderStyle = 3
flag1 = False
PicClip1.Picture = Picture2.Picture PicClip1.ClipX = 0
PicClip1.ClipY = 0
PicClip1.ClipHeight = PicClip1.Height
PicClip1.ClipWidth = PicClip1.Width Pic.Left = Pic.Left + Pic.Width / 2 - Pic.Width * ratio / 2
Pic.Top = Pic.Top + Pic.Height / 2 - Pic.Height * ratio / 2
Pic.Width = Pic.Width * ratio
Pic.Height = Pic.Height * ratio Pic.ScaleMode = 3 PicClip1.StretchX = Pic.ScaleWidth
PicClip1.StretchY = Pic.ScaleHeight Pic.Picture = PicClip1.Clip Pic.ScaleMode = SaveModeEnd Sub
BitBlt Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, hdc, 0, 155, &HCC0020 '截图
Printer.PaintPicture Picture1.Image, Picture1.Left, Picture1.Top, Form5.Width, Picture1.Height ’输出
ommonDialog1.CancelError = True
On Error GoTo ErrHandler
CommonDialog1.ShowPrinter