如何把Picture1中显示的图像copy到picture2中显示啊!因为我的图片来源是截取当前屏幕图像来的,求教各位高手。

解决方案 »

  1.   

    picture2.paint ...................
      

  2.   

    picture2.paint ...................
      

  3.   

    我在Picture1以显示图像的情况下再单击Command2,但Picture2没有任何显示
    Private Sub Command2_Click()
     Picture2.Picture = Picture1.Image
    End Sub
      

  4.   

    设置picture2 的autofresh = true  或在后面加句picture2.refresh
      

  5.   

    我的代码是这样写的!
    Private Sub Command2_Click()
    Picture2.Picture = Picture1.Image
    Picture2.Refresh
    End Sub
    但还是一个样!一点变化都没有啊!
      

  6.   

    我试过了!如果是picture1显示的图片是硬盘上的就可以!如果是从屏幕上截取的就不可以!以下是我的程序的全部代码
    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
    Picture1.ClswScreen = Screen.Width \ Screen.TwipsPerPixelX
    hScreen = Screen.Height \ Screen.TwipsPerPixelYPicture1.ScaleMode = vbPixels
    w = Picture1.ScaleWidth
    h = Picture1.ScaleHeight
    hdcscreen = GetDC(0)r = StretchBlt(Picture1.hdc, 0, 0, w, h, hdcscreen, 0, 0, wScreen, hScreen, vbSrcCopy)End SubPrivate Sub Command2_Click()
    Picture2.Picture = Picture1.Image
    Picture2.Refresh
    End Sub
    求高手教我!谢谢
      

  7.   

    用paint,用法和上面的StretchBlt相同
      

  8.   

    加上
    private sub form_load()
     picture1.autoredraw=true
     picture2.autoredraw=true
    end sub
      

  9.   

    用PaintPicture如果不行,就再用Bitblt吧,不行吗?