[PATCH v4 1/2] windowscodecs: Use IWICImagingFactory_CreatePalette in write_source.
Rémi Bernon
rbernon at codeweavers.com
Tue Feb 2 03:53:26 CST 2021
Instead of PaletteImpl_Create.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
v4: As an alternative to v3, with unix_lib.c copied to wmphoto instead,
as it seems to be preferred it over the #ifdef. I don't mind either.
dlls/windowscodecs/wincodecs_common.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/wincodecs_common.c b/dlls/windowscodecs/wincodecs_common.c
index 37ad7128f10..1b146908be9 100644
--- a/dlls/windowscodecs/wincodecs_common.c
+++ b/dlls/windowscodecs/wincodecs_common.c
@@ -121,9 +121,17 @@ HRESULT write_source(IWICBitmapFrameEncode *iface,
if (need_palette)
{
+ IWICImagingFactory *factory;
IWICPalette *palette;
- hr = PaletteImpl_Create(&palette);
+ hr = create_instance(&CLSID_WICImagingFactory, &IID_IWICImagingFactory, (void**)&factory);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = IWICImagingFactory_CreatePalette(factory, &palette);
+ IWICImagingFactory_Release(factory);
+ }
+
if (SUCCEEDED(hr))
{
hr = IWICBitmapSource_CopyPalette(converted_source, palette);
--
2.30.0
More information about the wine-devel
mailing list