怎么样才能用取到image.picture的数据,
且把image.picture存存储成byte()数据返回或者是二进制数据返回,最好在VB代码下

解决方案 »

  1.   

    要看你怎么用了,实在不行,用剪贴板也行
    clipboard.setdata image1.picture
    在你需要用到地方,再使用
    clipboard.getdata
    例如:
    image2.picture = clipboard.getdata
      

  2.   


    在窗体上隐藏放置一个PICTURE,
    同时读入图片到image1与PICTURE1 , ...
      

  3.   

    注释:Form 中有PictureBox并指定好图形,另一CommandBoxPrivate Declare Function GetObject Lib "gdi32" Alias "GetObjectA" _(ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) _As LongPrivate Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, _ByVal dwCount As Long, lpBits As Any) As LongPrivate Type BITMAPbmType As LongbmWidth As LongbmHeight As LongbmWidthBytes As LongbmPlanes As IntegerbmBitsPixel As IntegerbmBits As LongEnd TypePrivate Sub Command1_Click()Dim hBitmap As LongDim res As LongDim bmp As BITMAPDim byteAry() As ByteDim totbyte As Long, i As LonghBitmap = Picture1.Picture.Handleres = GetObject(hBitmap, Len(bmp), bmp) 注释:取得BitMap的结构totbyte = bmp.bmWidthBytes * bmp.bmHeight 注释:总共要多少个Byte来存图ReDim byteAry(totbyte - 1)注释:将该图全放进ByteAry中res = GetBitmapBits(hBitmap, totbyte, byteAry(0))Debug.Print "Total Bytes Copied :"; resDebug.Print "bmp.bmBits "; bmp.bmBitsDebug.Print "bmp.bmBitsPixel "; bmp.bmBitsPixel 注释:每个Pixel需多少Bits来表现Debug.Print "bmp.bmHeight "; bmp.bmHeight 注释:bitmap图的高是多少PixelsDebug.Print "bmp.bmPlanes "; bmp.bmPlanesDebug.Print "bmp.bmType "; bmp.bmType Debug.Print "bmp.bmWidth "; bmp.bmWidth 注释:BitMap图宽为多少pixels Debug.Print "bmp.bmWidthBytes "; bmp.bmWidthBytes 注释:每条扫描线需多少Byte来存End Sub