Parameters
nWidth
[in] Specifies the bitmap width, in pixels.
nHeight
[in] Specifies the bitmap height, in pixels.
cPlanes
[in] Specifies the number of color planes used by the device.
cBitsPerPel
[in] Specifies the number of bits required to identify the color of a
single pixel.
lpvBits
[in] Pointer to an array of color data used to set the colors in a
rectangle of pixels. Each scan line in the rectangle must be word aligned
(scan lines that are not word aligned must be padded with zeros). If this
parameter is NULL, the contents of the new bitmap is undefined.
You can set the cBitsPerPixel to 32 and leave the lpvBits as null.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
> Hi,
>
[quoted text clipped - 16 lines]
>
> Thx.
Flo - 14 Sep 2005 09:20 GMT
First thanks a lot for answering my question so quickly. But my question was
more about where are the data of the bitmap stored in the bitmap .NET object ?
For example, i instanciated a .NET bitmap object and i would like to call
the API CreateBitmap function to make a copy of the bitmap i got. I know
where to find the informations concerning the 4 first parameters (width,
height, number of planes, number of bits), but i have no clue where the data
of the bitmap is stored in the .NET Bitmap object.
Maybe u can help me with a sample implementation on how to retrieve these
data and to call the CreateBitmap function in order to get the similar
bitmap?
Thanks a lot. Regards.
> Parameters
> nWidth
[quoted text clipped - 12 lines]
> parameter is NULL, the contents of the new bitmap is undefined.
> You can set the cBitsPerPixel to 32 and leave the lpvBits as null.
Bob Powell [MVP] - 14 Sep 2005 20:13 GMT
To get access to the image data itself you need to use the LockBits method.
The article on my site explains LockBits in great detail.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
> First thanks a lot for answering my question so quickly. But my question
> was
[quoted text clipped - 30 lines]
>> parameter is NULL, the contents of the new bitmap is undefined.
>> You can set the cBitsPerPixel to 32 and leave the lpvBits as null.
Flo - 14 Sep 2005 21:55 GMT
Thanks very much for the article Bob, this was exactly what i was looking for.
> To get access to the image data itself you need to use the LockBits method.
>
> The article on my site explains LockBits in great detail.