因为画了张图,希望能够复制或导出

解决方案 »

  1.   

    使用SavePicture方法Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function StretchBlt Lib "gdi32" (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 LongPrivate Sub Command1_Click()
    Dim wScreen As Long
    Dim hScreen As Long
    Dim w As Long
    Dim h As Long
    Dim pic As PictureBox
    Picture1.Cls
    Picture1.AutoRedraw = True
    wScreen = Screen.Width \ Screen.TwipsPerPixelX
    hScreen = Screen.Height \ Screen.TwipsPerPixelY
    Picture1.ScaleMode = vbPixels
    w = Picture1.ScaleWidth
    h = Picture1.ScaleHeight
    hdcScreen = GetDC(0)
    p = StretchBlt(Picture1.hdc, 0, 0, w, h, hdcScreen, 0, 0, wScreen, hScreen, vbSrcCopy)
    Picture1.RefreshEnd SubPrivate Sub Command2_Click()
    SavePicture Picture1.Image, "c:\111.bmp"
    End Sub
      

  2.   

    Private Sub Command1_Click()
     Me.Picture1.AutoRedraw = True
     Me.Picture1.Line -(1000, 1000), vbRed
     SavePicture Me.Picture1.Image, "D:\Name1.bmp"
    End Sub