Windows Programming: ID2D1Bitmap Interface - Getting the Bitmap Data

Posted by LostInBrackets on Stack Overflow See other posts from Stack Overflow or by LostInBrackets
Published on 2010-05-02T22:00:30Z Indexed on 2010/05/02 22:08 UTC
Read the original article Hit count: 454

Filed under:
|
|

I've been writing my own library of functions to access some of the new Direct2D Windows libraries. In particular, I've been working on the ID2D1Bitmap interface. I wanted to write a function to return a pointer to the start of the bitmap data (for the editing of particular pixels, or custom encoding or whatever else I might wish for in the future). Unfortunately... problem ahead...

I can't seem to find a way to get access to the raw pixel data from the ID2D1Bitmap Interface.

Does anyone have an idea how to access this? One of my friends suggested drawing the bitmap to a surface and extracting the bitmap data from there. I don't know if this would work. It definitely seems inefficient and I wouldn't know which kind of surface to use.

Any help is appreciated. (c++ in particular, but I assume the code won't be tooo different between languages)

(I know I could just read in the data direct from the file, but I'm using the WIC decoders which means it could be in any number of indecipherable formats)

© Stack Overflow or respective owner

Related posts about Windows

Related posts about c++