[PATCH 1/9 v3] gdiplus: Add partial support for GdipDrawImagePointsRect on metafile

Dmitry Timoshkov dmitry at baikal.ru
Fri Jun 30 09:14:18 CDT 2017


Piotr Caban <piotr at codeweavers.com> wrote:

> +static GpStatus METAFILE_CreateCompressedImageStream(GpImage *image, IStream **stream, DWORD *size)
> +{
> +    static const CLSID png_clsid = { 0x557cf406, 0x1a04, 0x11d3,
> +        { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } };
> +    LARGE_INTEGER zero;
> +    STATSTG statstg;
> +    GpStatus stat;
> +    HRESULT hr;
> +
> +    *size = 0;
> +
> +    hr = CreateStreamOnHGlobal(NULL, TRUE, stream);
> +    if (FAILED(hr)) return hresult_to_status(hr);
> +
> +    stat = GdipSaveImageToStream(image, *stream, &png_clsid, NULL);

Even internally gdiplus shouldn't do this kind of hacks IMO, if there is
a need for a shortcut for a particular encoder class id it's better to
add a helper. Have a look at the encoder/decoder tests how it's supposed
to look like.

-- 
Dmitry.



More information about the wine-devel mailing list