G
Guest
Hi,
I do have a Bitmap object in a C# application, i would like to create a
bitmap using the GDI function CreateBitmap which could return me a valid
HBITMAP (Dont want to use the GetHBitmap method which returns a 24bits bitmap
which will loose any Alpha informations like transparency).
The declaration for the function will probably look like this :
[DllImport("gdi32.dll")]
public static extern IntPtr CreateBitmap(int nWidth, int nHeight, uint
cPlanes, uint cBitsPerPel, short[] lpvBits);
But i have no clue how to provide the parameters CBitsPerPel and lpvBits,
and what they do correspond to in the .NET Bitmap object.
Any idea how i could call this function properly ?
Thx.
I do have a Bitmap object in a C# application, i would like to create a
bitmap using the GDI function CreateBitmap which could return me a valid
HBITMAP (Dont want to use the GetHBitmap method which returns a 24bits bitmap
which will loose any Alpha informations like transparency).
The declaration for the function will probably look like this :
[DllImport("gdi32.dll")]
public static extern IntPtr CreateBitmap(int nWidth, int nHeight, uint
cPlanes, uint cBitsPerPel, short[] lpvBits);
But i have no clue how to provide the parameters CBitsPerPel and lpvBits,
and what they do correspond to in the .NET Bitmap object.
Any idea how i could call this function properly ?
Thx.