Read a picture from Access DB into PictureBox

前端 未结 5 1848
情深已故
情深已故 2021-01-20 17:33

I have been trying to read a picture saved in Access DB as a OLE object in a PictureBox in a C# windows Application.

The code that does this is presented below:

5条回答
  •  借酒劲吻你
    2021-01-20 18:24

    Unfortunately I have no good answer for you, but I can tell you that when I tried, I got the same results. Sometimes skipping the first 78 bytes of the byte array worked, sometimes it didn't.

    This is because the OLE Object datatype stores some kind of header in the field, so that Access knows what type of OLE Object it is. I could not find a reliable way to work out exactly where this header stopped and real data started, but I also gave up, so good luck :)

提交回复
热议问题