CopyImage for IMAGE_BITMAP still not right, next Try

Dmitry Timoshkov dmitry at baikal.ru
Tue Sep 20 06:48:31 CDT 2005


"Uwe Bonnes" <bon at 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 );

This doesn't look right. You need to call GetBitmapBits the second time
with "size" returned from a previous GetBitmapBits call, just like you do
in SetBitmapBits.

-- 
Dmitry.




More information about the wine-devel mailing list