Hi Carmen,
sorry for my later but today I haven't readed this newsgroup
Ok let's go:
I have modified The OpenNetCF.Drawing.BitmMapEx class in a way that
I can create a BitmapEx object by a HBITMAP handler created with
CreateDIBSection function using the OpenNetCF.Drawing.GDIPlus class ( I make them
public instead of internal....)
After I created the
GDIPlus.BITMAPINFO structure declared in this way:
public struct RGBQUAD
{
public byte rgbBlue;
public byte rgbGreen;
public byte rgbRed;
public byte rgbReserved;
}
[CLSCompliantAttribute(false)]
public struct BITMAPINFO
{
public BITMAPINFOHEADER bmiHeader;
public RGBQUAD bmiColors0;
public RGBQUAD bmiColors1;
}
After that I created the bitmap with this code:
IntPtr s;
unsafe
{
GDIPlus.BITMAPINFO info;
info.bmiHeader.biBitCount = 1;
info.bmiHeader.biPlanes = 1;
info.bmiHeader.biHeight = 10000;
info.bmiHeader.biWidth = 10000;
info.bmiHeader.biCompression = 0; //BI_RGB
info.bmiHeader.biClrUsed = 2;
//this should be 40
info.bmiHeader.biSize = (uint)sizeof(GDIPlus.BITMAPINFOHEADER);
IntPtr pBits = IntPtr.Zero;
IntPtr hFile = IntPtr.Zero;
hBitmap = GDIPlus.CreateDIBSection(IntPtr.Zero,pInfo,0,ref pBits,hFile,0);
for (int y = 0; y < 30; y++ )
{
for (int x = 0; x < 30; x++ )
{
byte* pointer = (byte *)pBits.ToPointer();
pointer[ x + y * 10 ] = 0;
}
}
}
m_BitMap = new BitmapEx(hBitmap);
as you can see, now I can crate and draw (With OpenNETCF.Drawing.GraphicEx.DrawImage) 10000 x 10000
bitmap with 1 bitdepth.
note: the double for cicle is not correct, I know, but this is only example to see
if this approach was correct.
note2: when you make GDIPlus pubblic You will see many compile error (40 or 50 more or less)
that says the element "bla bla" is not CLSCompliant...so before that you write:
[CLSCompliantAttribute(false)]
and the problem is resolved
bye Davide