Dim RS As Recordset

RS = TBOpen(strQUERY, True)

If Not RS.EOF Then
    Try
        Dim img As Object = RS.Fields("IMG").Value
        If img Is Nothing Then
   
        ElseIf IsDBNull(img) Then
            .Cells(35, 14).CellType = Nothing
        Else
            Dim strm As System.IO.Stream = New System.IO.MemoryStream(CType(img, Byte()))
            Dim img1 As Bitmap = New Bitmap(strm)
            Dim imgType As New FarPoint.Win.Spread.CellType.GeneralCellType
            imgType.BackgroundImage = New FarPoint.Win.Picture(img1, FarPoint.Win.RenderStyle.Stretch, Color.White, FarPoint.Win.HorizontalAlignment.Center, FarPoint.Win.VerticalAlignment.Center)  ' img1 
'New Picture(Image.FromStream(s))
            .Cells(35, 14).CellType = imgType
        End If
   
    Catch ex As Exception
   
    End Try

End If

밑줄그은 부분이 중요하다. 스트림으로 저장된 데이터를 이미지 타입인 비트맵으로 변환하는 과정이므로 유심히 보고 실행해 보자.

+ Recent posts