Converting an OLE Image Object from MS Access for use in .NET

后端 未结 5 1235
清歌不尽
清歌不尽 2020-12-20 18:06

I\'m working on redeveloping an Access based system into c#.net, however when MS went from office 2003 to office 2007 they removed the picture editor within access - which m

5条回答
  •  -上瘾入骨i
    2020-12-20 19:05

    It is not C# code but here is an Delphi example of a way to solve this problem.

    It uses the IOLEObject to draw whatever is stored instead of trying to read out the raw data. Steps:

    1. Read the Access Header in front of the OLE Object
    2. Read out the OLE1 stream
    3. Convert the OLE1 stream to an OLE2 IStorage Object
    4. Use OLELoad to "run" the OLE Ojbect.
    5. Call OLEDraw to draw out the image to a canvas of your choice.

提交回复
热议问题