"Dmitry" == Dmitry Timoshkov dmitry@baikal.ru writes:
Dmitry> "Uwe Bonnes" bon@elektron.ikp.physik.tu-darmstadt.de wrote: >> if ((res = CreateBitmapIndirect(&bm))) { - char *buf = HeapAlloc( >> GetProcessHeap(), 0, bm.bmWidthBytes * bm.bmHeight ); + LONG size = >> GetBitmapBits( hnd, 0, NULL ); + char *buf = HeapAlloc( >> GetProcessHeap(), 0, size ); GetBitmapBits( hnd, bm.bmWidthBytes * >> bm.bmHeight, buf ); - SetBitmapBits( res, bm.bmWidthBytes * >> bm.bmHeight, buf ); + SetBitmapBits( res, size, buf );
Dmitry> This doesn't look right. You need to call GetBitmapBits the Dmitry> second time with "size" returned from a previous GetBitmapBits Dmitry> call, just like you do in SetBitmapBits.
If I do that, I get an X Error:
X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 73 (X_GetImage) Serial number of failed request: 34307 Current serial number in output stream: 34307
The bitmap in question in Avrstudio from Atmel is a four bit one. With the code above, serveral errors like: err:x11drv:X11DRV_CreateBitmap Trying to make bitmap with planes=1, bpp=4 err:x11drv:X11DRV_CreateBitmap Trying to make bitmap with planes=1, bpp=4 err:x11drv:X11DRV_CreateBitmap Trying to make bitmap with planes=1, bpp=4 err:x11drv:X11DRV_CreateBitmap Trying to make bitmap with planes=1, bpp=4
are produced.
B.t.w. to get Avrstudio to run until that error happens, start it like env WINEDLLOVERRIDES=msvcrt,msxml3,ole32,oleaut32,rpcrt4,urlmon=n /spare/bon/wine/wine/wine AvrStudio4/AVRStudio.exe
Bye