Erich Hoover <ehoover(a)mines.edu> writes:
> @@ -508,35 +517,90 @@ static Cursor create_xcursor_cursor( HDC hdc, ICONINFO *icon, int width, int hei
> info->bmiHeader.biYPelsPerMeter = 0;
> info->bmiHeader.biClrUsed = 0;
> info->bmiHeader.biClrImportant = 0;
> - GetDIBits( hdc, icon->hbmColor, 0, height, image->pixels, info, DIB_RGB_COLORS );
> + hbmColor = CreateDIBSection( hdc, info, DIB_RGB_COLORS, (VOID **) &mem_bits, NULL, 0);
> + if (!hbmColor)
> + {
> + ERR("Failed to create DIB section for image!\n");
> + goto cleanup;
> + }
> + SelectObject( hdc, hbmColor );
> + if (!DrawIconEx( hdc, 0, 0, icon, width, height, istep, NULL, DI_NORMAL ))
> + {
> + TRACE("Could not draw frame %d (walk past end of frames).\n", istep);
> + goto cleanup;
> + }
> + memcpy(image->pixels, mem_bits, info->bmiHeader.biSizeImage);
You should be reusing the info, DC and bitmap objects for all frames
instead of always recreating everything from scratch.
--
Alexandre Julliard
julliard(a)winehq.org