ImageEn, unit ImageEnIO

TImageEnIO.LoadFromStreamWIC

TImageEnIO.LoadFromStreamWIC

Declaration

function LoadFromStreamWIC(Stream: TStream; FileType: TIOFileType = ioUnknown): Boolean;

Description

Loads an image from a stream using the WIC API.
The result will be False if an error is encountered, e.g. the file in the stream is not a compatible format (Aborting will be True).
You can set FileType to use a specific decoder, but it is better to use ioUnknown so the decoder is selected automatically.

Note:
◼Some WIC formats require installation of a codec from the Microsoft store
◼See WIC_Load_FileTypes for a list of WIC supported file types
◼You can abort loading by setting Aborting to True
◼LoadFromStreamWIC does not reset the position of the stream, so you may need to first call Stream.Position := 0;
◼If NativePixelFormat = True, the image will be returned in ie32RGB format with alpha in the A channel

Example

// Load a raw camera file using WIC
ImageEnView1.IO.LoadFromStreamWIC( fs, ioRAW );

See Also

◼LoadFromFileWIC
◼SaveToStreamWIC
◼WIC_Load_FileTypes
◼WIC_FileTypes