Results 1 to 3 of 3

Thread: using FreeImage tools in VB.net

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    6

    using FreeImage tools in VB.net

    Dear All
    I am using this code to display image in datagridview which is ok with jpg image format but if any record has jpeg2000 format I got invalid parameters.
    After trying a lot of solutions I found FreeImage tools to solve this error with jpeg2000 format but I don't know how to use it in vb.net to dispaly both format jpg & jpeg2000.
    Code:
     OleDbDataAdapter1.SelectCommand = OleDbSelectCommand1
    OleDbSelectCommand1.CommandText = "SELECT P_IMAGE FROM PORTLOB
    
    OleDbSelectCommand1.Connection = OleDbConnection1
    
    DataSet11.PORT_IMAGE.Clear()
    OleDbConnection1.Open()
    Try
        OleDbDataAdapter1.Fill(DataSet11)
        Dim c As Integer = DataSet11.Tables("PORT_IMAGE").Rows.Count
        If c > 0 Then
            Dim ba() As Byte = DataSet11.Tables("PORT_IMAGE").Rows(c - 1)("P_IMAGE")
            Dim tc As TypeConverter = TypeDescriptor.GetConverter(GetType(Bitmap))
            Dim bmp As Bitmap = tc.ConvertFrom(ba)
            DataGridView1.DataSource = DataSet11.Tables("PORT_IMAGE")
            For Each Item As DataGridViewRow In DataGridView1.Rows
                Item.Height = 250
            Next
        End If
    Catch Ex As OleDb.OleDbException
        MessageBox.Show(Ex.Message)
    End Try
    OleDbConnection1.Close()
    Thanks and Best Regards
    Last edited by Shaggy Hiker; Nov 11th, 2020 at 12:20 PM. Reason: Added CODE tags.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: using FreeImage tools in VB.net

    How EXACTLY are you using this FreeImage tools?

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    6

    Re: using FreeImage tools in VB.net

    I have 2 images format in the same column I can display one of them without any problem but the other give me invalid parameter it is jpeg2000 color image
    I have problem to this picture it is blob start with this string "0000000C6A5020200D0A870A00000014667479706A7032204D322E316A7032200000002D6A7032680000001669686472000 00280000001E0000307070000000000"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width