下面是一段从数据库中读取图象并在IMAGE中显示的代码,应该对你有帮助: ''''''读取数据库中图象字段数据''''''''''''''''''''''
lStrSqlString = "select FD_Photo from TB_XT_Person where FD_WorkID='" + frmPerson.mshfPerson.TextMatrix(frmPerson.mshfPerson.Row, 2) + "'"
lRecRecords.Open lStrSqlString, gConnGeneral, 1, 3
Dim lbytImageStream() As Byte
Dim lLngFileLen As Long
lLngFileLen = lRecRecords("FD_Photo").ActualSize
If lLngFileLen = 0 Then Exit Sub
lbytImageStream = lRecRecords("FD_Photo").GetChunk(lLngFileLen)
''''''并写入一临时文件'''''''''''''''''''''''''''''
Open "temp.bmp" For Binary As #1
Put #1, 1, lbytImageStream
Close #1 imgPersonPhoto.Picture = LoadPicture("temp.bmp")
lStrSqlString = "select FD_Photo from TB_XT_Person where FD_WorkID='" + frmPerson.mshfPerson.TextMatrix(frmPerson.mshfPerson.Row, 2) + "'"
lRecRecords.Open lStrSqlString, gConnGeneral, 1, 3
Dim lbytImageStream() As Byte
Dim lLngFileLen As Long
lLngFileLen = lRecRecords("FD_Photo").ActualSize
If lLngFileLen = 0 Then Exit Sub
lbytImageStream = lRecRecords("FD_Photo").GetChunk(lLngFileLen)
''''''并写入一临时文件'''''''''''''''''''''''''''''
Open "temp.bmp" For Binary As #1
Put #1, 1, lbytImageStream
Close #1 imgPersonPhoto.Picture = LoadPicture("temp.bmp")
lStrSqlString = "select FD_Photo from TB_XT_Person where FD_WorkID='" + frmPerson.mshfPerson.TextMatrix(frmPerson.mshfPerson.Row, 2) + "'"
lRecRecords.Open lStrSqlString, gConnGeneral, 1, 3
Dim lbytImageStream() As Byte
Dim lLngFileLen As Long
lLngFileLen = lRecRecords("FD_Photo").ActualSize
If lLngFileLen = 0 Then Exit Sub
lbytImageStream = lRecRecords("FD_Photo").GetChunk(lLngFileLen)
''''''并写入一临时文件'''''''''''''''''''''''''''''
Open "temp.bmp" For Binary As #1
Put #1, 1, lbytImageStream
Close #1 imgPersonPhoto.Picture = LoadPicture("temp.bmp")
再请问一下
Open "temp.bmp" For Binary As #1
Put #1, 1, lbytImageStream
Close #1
是把一个二进制写成temp.bmp
把过来怎么做
把temp.bmp写成二进制怎么做