M
Matthias Müller
Hello,
I know, that this here is possibly not the right ng to ask, but I do it,
because I hope Stephen Lebans can help me.
I have an mdb with a Table, containing pictures. Some of them are "Bitmap",
some are "Bild" (wich I think is "Image" or "Picture" - I'm using the german
version).
I try to show these Pictures from a VB.NET-Application. I can show
"Bitmap"s, but I can't show "Bild". I think "Bild" is a DIB, but I found no
way to show it.
Here the code used:
-----------------------------------------------------------------
' Get Data
Me.OleDbDataAdapterFotos.SelectCommand.CommandText = "SELECT PID, Foto FROM
PersonFoto WHERE PID = " & myPIDtoSearch
Dim myDSF As DataSet = New DataSet
Me.OleDbDataAdapterFotos.Fill(myDSF)
Dim myF As System.Data.DataRow()
myF = myDSF.Tables("PersonFoto").Select("PID = " & myPIDtoSearch)
Dim myMemStream As MemoryStream
' Cut first Bytes (probably the OLE-Header)
myMemPictStream.Write(myF(0)("Foto"), 73 - 1, UBound(myF(0)("Foto")) - 73 +
1)
Try
b = New Bitmap(myMemPictStream)
Me.Foto.Image = b
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OKOnly Or MsgBoxStyle.Information, "Ups")
Me.Foto.Image = Nothing
End Try
-----------------------------------------------------------------------------
This works fine with "Bitmap".
But it doesn't work with "Bild" ("Image" or "Picture"). This always returns
an Excption: "Invalid Parameter"
Is there a way to show these "Bild"-Element outside Access? Does anybody
know something about the format of "Bild"?
Thank You for your help (and excuse my poor english).
Matthias Müller
I know, that this here is possibly not the right ng to ask, but I do it,
because I hope Stephen Lebans can help me.
I have an mdb with a Table, containing pictures. Some of them are "Bitmap",
some are "Bild" (wich I think is "Image" or "Picture" - I'm using the german
version).
I try to show these Pictures from a VB.NET-Application. I can show
"Bitmap"s, but I can't show "Bild". I think "Bild" is a DIB, but I found no
way to show it.
Here the code used:
-----------------------------------------------------------------
' Get Data
Me.OleDbDataAdapterFotos.SelectCommand.CommandText = "SELECT PID, Foto FROM
PersonFoto WHERE PID = " & myPIDtoSearch
Dim myDSF As DataSet = New DataSet
Me.OleDbDataAdapterFotos.Fill(myDSF)
Dim myF As System.Data.DataRow()
myF = myDSF.Tables("PersonFoto").Select("PID = " & myPIDtoSearch)
Dim myMemStream As MemoryStream
' Cut first Bytes (probably the OLE-Header)
myMemPictStream.Write(myF(0)("Foto"), 73 - 1, UBound(myF(0)("Foto")) - 73 +
1)
Try
b = New Bitmap(myMemPictStream)
Me.Foto.Image = b
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OKOnly Or MsgBoxStyle.Information, "Ups")
Me.Foto.Image = Nothing
End Try
-----------------------------------------------------------------------------
This works fine with "Bitmap".
But it doesn't work with "Bild" ("Image" or "Picture"). This always returns
an Excption: "Invalid Parameter"
Is there a way to show these "Bild"-Element outside Access? Does anybody
know something about the format of "Bild"?
Thank You for your help (and excuse my poor english).
Matthias Müller