IWICImagingFactory

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

Post Reply
gisjr134
Posts: 44
Joined: Tue Dec 08, 2020 11:37 am
DBs Used: DBF,MySQL,PostgreSQL
Location: Brasil
Contact:

IWICImagingFactory

Post by gisjr134 »

Hi To All ,

I Am Trying To Draw a TRansparent PNG in My Browser Project using The IWICImagingFactory Interface , But I Always Get This Error.

#include <windows.h>
#include <wincodec.h>

void DrawPng( HDC hDC, HBITMAP hbm, WORD wRow, WORD wCol )
{

IWICImagingFactory* pIWICFactory = NULL;
CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (LPVOID*)&pIWICFactory);

IWICBitmapDecoder* pDecoder = NULL;
pIWICFactory->CreateDecoderFromFilename(L"sua_imagem.png", NULL, GENERIC_READ, WICDecodeMetadataCacheOnDemand, &pDecoder);

xBrowser1.png
xBrowser1.png (11.79 KiB) Viewed 3600 times

Error Message:

from ../../../.hbmk/win/mingw64/ObjBrwDb.c:7:
c:/mingw64/x86_64-w64-mingw32/include/stdlib.h:400:32: note: expected 'const char *' but argument is of type 'TCHAR *' {aka 'short unsigned int *'}
int __cdecl atoi(const char *_Str);
~~~~~~~~~~~~^~~~
ObjBrwDb.Prg:4734:6: warning: unused variable 'hDcBmp' [-Wunused-variable]
ObjBrwDb.Prg: In function 'DrawMasked':
ObjBrwDb.Prg:5333:76: error: incompatible type for argument 4 of 'CoCreateInstance'
In file included from c:/mingw64/x86_64-w64-mingw32/include/objbase.h:14,
from c:/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
from c:/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
from c:/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
from c:/mingw64/x86_64-w64-mingw32/include/windows.h:97,
from ObjBrwDb.Prg:3658:
c:/mingw64/x86_64-w64-mingw32/include/combaseapi.h:256:94: note: expected 'const IID * const' {aka 'const struct _GUID * const'} but argument is of type 'GUID' {aka 'const struct _GUID'}
WINOLEAPI CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID *ppv);

I Think Harbour compilator generate some kind of Conflict or This Code Works only in C++ , i am using Harbur 64 Bits and Mingw 64 bits.

Any Help? Thanks in Advance
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: IWICImagingFactory

Post by IMATECH »

M., Ronaldo

By: IMATECH

Imation Tecnologia
Post Reply