![]() |
How to work with WIC?
Today I discover new technology called
![]()
Delphi-Quellcode:
For example how to get installed codecs (names and extensions, eg. to add format to dialogs). Or how to get some info about format and manipulate format during file saving? Or manipulate image? Do you have some experience with this? This looks to be good method to read RAW images.
// Function() to test if this engine working correctly
function WICImageFormatDescription(const WIC: TWICImage): string; begin Result := ''; case WIC.ImageFormat of wifBmp: Result := 'Bitmap'; wifPng: Result := 'PNG'; wifJpeg: Result := 'JPEG'; wifGif: Result := 'GIF'; wifTiff: Result := 'TIFF'; wifWMPhoto: Result := 'JPEG XR'; wifOther: begin if GUIDToString(WIC.EncoderContainerFormat) = GUIDToString(GUID_ContainerFormatIco) then Result := 'Icon' else Result := 'other' ; end; end; end; var WIC: TWICImage; begin WIC := TWICImage.Create; try if OpenPictureDialog.Execute then begin WIC.LoadFromFile(OpenPictureDialog.FileName); Image.Picture.Assign(WIC); ShowMessage(WICImageFormatDescription(WIC)); WIC.ImageFormat := wifWMPhoto; WIC.SaveToFile('output.wdp'); end; finally WIC.Free; end; end; PS: Is there better method to compare GUIDs than I wrote? PS2: Do you know native Delphi libs to support image formats? Something like GraphicsEe, but updated to latest format versions (GrEx for example can't read last TIFFs). |
Re: How to work with WIC?
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:50 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz