我使用了一个函数
 Set Image1(1) = conf.m_PersonPic(usename)
conf.m_PersonPic(usename)返回值是一个ipicturedisp的变量,m_PersonPic是由conf控件提供的一个函数。有的时候能正常显示图像,有的时候什么都显示不了,image1上就显示了一片空白的底色。我怎么能判断conf.m_PersonPic(usename)的返回值到底有没有图像呢?

解决方案 »

  1.   

    图片是用二进制保存的,所以最好是用流文件格式读取。然后判断长度是多少。非空白的应该大于0才对。Dim rByte() As Byte
                Dim lngLenth As Long
                
                lngLenth = rs.Fields("NorFileContent").ActualSize
                If lngLenth > 0 Then
                    rByte = rs.Fields("NorFileContent").GetChunk(lngLenth) 
                    'add code in here
                Else
                    ReadFileFromDB = ""
                End If
      

  2.   

    If Image1.Picture = 0 Then MsgBox "Image1中无图像!"picturebox 也是这样的。