TImageEnIO.LoadFromStreamWebP
Declaration
function LoadFromStreamWebP(Stream: TStream): Boolean;
Description
Loads an image from a stream containing a WebP file.
The result will be False if an error is encountered, e.g. the file in the stream is not WebP format (
Aborting will be True).
The method used to load WebP files is specified by
ActiveWebPEngine.
Note:
◼You can select which frame to load using
ImageIndex (0..ImageCount-1). Animated WebP requires a current
iewebp32.dll /
iewebp64.dll
◼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
var
fs: TFileStream;
begin
fs := TFileStream.Create( 'D:\myfile.WebP', fmOpenRead );
if ImageEnView1.IO.LoadFromStreamWebP( fs ) = False then
ShowMessage('Not a WebP file!');
fs.Free();
end;
See Also
◼LoadFromFileWebP
◼SaveToFileWebP