gdiplus: Save total and current frame in the image structure.

This commit is contained in:
Dmitry Timoshkov 2012-05-16 23:33:48 +09:00 committed by Alexandre Julliard
parent c5697ff4b1
commit 007d642e53
2 changed files with 12 additions and 1 deletions

View File

@ -266,6 +266,7 @@ struct GpImage{
ImageType type;
GUID format;
UINT flags;
UINT frame_count, current_frame;
UINT palette_flags;
UINT palette_count;
UINT palette_size;

View File

@ -1767,6 +1767,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
(*bitmap)->image.type = ImageTypeBitmap;
memcpy(&(*bitmap)->image.format, &ImageFormatMemoryBMP, sizeof(GUID));
(*bitmap)->image.flags = ImageFlagsNone;
(*bitmap)->image.frame_count = 1;
(*bitmap)->image.current_frame = 0;
(*bitmap)->image.palette_flags = 0;
(*bitmap)->image.palette_count = 0;
(*bitmap)->image.palette_size = 0;
@ -2591,7 +2593,7 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, GpImage **imag
WICPixelFormatGUID wic_format;
PixelFormat gdip_format=0;
int i;
UINT width, height;
UINT width, height, frame_count;
BitmapData lockeddata;
WICRect wrc;
HRESULT initresult;
@ -2604,7 +2606,11 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, GpImage **imag
hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)stream, WICDecodeMetadataCacheOnLoad);
if (SUCCEEDED(hr))
{
IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
/* FIXME: set current frame */
hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
}
if (SUCCEEDED(hr)) /* got frame */
{
@ -2696,6 +2702,8 @@ end:
{
/* Native GDI+ used to be smarter, but since Win7 it just sets these flags. */
bitmap->image.flags |= ImageFlagsReadOnly|ImageFlagsHasRealPixelSize|ImageFlagsHasRealDPI|ImageFlagsColorSpaceRGB;
bitmap->image.frame_count = frame_count;
bitmap->image.current_frame = 0;
}
return status;
@ -2765,6 +2773,8 @@ static GpStatus decode_image_olepicture_metafile(IStream* stream, REFCLSID clsid
(*image)->type = ImageTypeMetafile;
(*image)->picture = pic;
(*image)->flags = ImageFlagsNone;
(*image)->frame_count = 1;
(*image)->current_frame = 0;
(*image)->palette_flags = 0;
(*image)->palette_count = 0;
(*image)->palette_size = 0;