Public Shared Function GetImageFromByteArray(ByVal picData As Byte()) As Image
Dim img As Image = Nothing
Try
If picData Is Nothing Then Exit Try
Dim bmData As Integer = IIf((picData(0) = 21 Or picData(1) = 28), 78, 0)
Dim ms As New MemoryStream(picData, bmData, picData.Length - bmData)
img = Image.FromStream(ms)
Catch
End Try
Return img
End Function
我是通过 GetImageFromByteArray(FpSpread1_Sheet1.Cells(i, FpSpread1_Sheet1.Columns("mainpic").Index).Value) 获取image正常,但是复制给FpSpread1_Sheet1.Cells(i, FpSpread1_Sheet1.Columns("mainpic").Index).Value时候出错 |