Re: save DC as bitmap to file
matthias.pospiech@gmx.de wrote:
This class will help a lot. And it will execute very quickly (compared
to SetPixel)!
http://www.codeproject.com/bitmap/DIBSection.asp
It looks like it can display real *.bmp Data really good, but I am
dealing with arrays of data that shall be displayed. These have to be
transformed to a Bitmap first. I would expect to use a CBitmap class
for that, but DIBSection does not seem to use CBitmaps at all. So I
wonder if I really can use that code for my purpose?
The question would still be how to save the array to something
(CBitmap?) in a waythat is faster than setpixel?
Matthias
DIBSection is what you want. A CBitmap does not contain the pixel data,
only a handle to data stored by Windows. A DIBSection does contain the
pixel data, in arrays of memory you can allocate, read and write. If I
recall, the referenced article contains code to display the in-memory
bitmap and to read/write it to file.
--
Scott McPhillips [VC++ MVP]