How to create a lossless jpg using WIC in Delphi
I have the following code working to create a jpg file out of a IWICBitmapSource with defaults options: function SaveWICBitmapToJpgFile(WICFactory: IWICImagingFactory; WICBitmap: IWICBitmapSource; SrcRect: TRect; FileName: string): HRESULT; var hr: HRESULT; Encoder: IWICBitmapEncoder; Frame: IWICBitmapFrameEncode; PropBag: IPropertyBag2; S: IWICStream; PixelFormatGUID: WICPixelFormatGUID; R: WICRect; begin hr := WICFactory.CreateStream(S); if Succeeded(hr) then begin hr := S.InitializeFromFilename(PChar(FileName), GENERIC_WRITE); end; if Succeeded(hr) then begin hr := WICFactory.CreateEncoder