none
Unable to create a WIC decoder/encoder in C#. Need help! RRS feed

  • Общие обсуждения

  • I am a C# programmer on Vista machine and I am exploring WIC engine...

    Have some problems with explicitly creation of a WIC decoder or encoder.

    The code below is worked fine:

    IWICBitmapDecoder jpegdecoder = wicImagingFactory.CreateDecoderFromFilename(
    file, ref guidNull, GENERIC_READ, WICDecodeOptions.WICDecodeMetadataCacheOnDemand);

    while the explicitly creation of a decoder/encoder shows me the error with HRESULT: 0x88982F50
    
    Guid guid_JpegDecoder = new Guid("9456A480-E88B-43EA-9E73-0B2D9B71B1CA");
    IWICBitmapDecoder jpegdecoder = wicImagingFactory.CreateDecoder(
    ref guid_JpegDecoder, ref GUID_VendorMicrosoft);

    I checked the Registry branch: HKEY_CLASSES_ROOT\CLSID\{9456A480-E88B-43EA-9E73-0B2D9B71B1CA}
    Seems all is OK.

    This is how I create ImagingFactory:
    // Initialize a factory
    Guid CLSID_WICImagingFactory = new Guid("cacaf262-9370-4615-a13b-9f5539da4c0a");
    Type WICImagingFactoryType = Type.GetTypeFromCLSID(CLSID_WICImagingFactory, true);
    wicImagingFactory = (IWICImagingFactory)Activator.CreateInstance(
    WICImagingFactoryType);

    Can anyone explain me what is the matter? Thanks in advance.

    Murat