Commit 007d642e authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

parent c5697ff4
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment