I am trying to make a PNG to ICON converter, just to practice Windows Imaging Component, I have run into a problem concerning the CreateEncoder
function of IWICImagingFactory
.
IWICBitmapEncoder* encoder;
HRESULT res = imgFactory->CreateEncoder(GUID_ContainerFormatIco, &vendor,
&encoder);
std::cout << _com_error(res).ErrorMessage() << std::endl;
This gives an error in HRESULT
, with the message "The component cannot be found," what's interesting is this only happens with GUID_ContainerFormatIco
, If I try and convert to Tiff, or Jpeg it works completely fine.
So, why can I not create a WICBitmapEncoder that encodes .ico files? I was hypothesizing it might be something to do with icon restrictions (because icons may have to be 32x32, 16x16) this could make it less straightforward, i am not sure though.