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:
◼Multiple frame WebP files are not supported (only the first image is loaded)
◼Does not reset the position of the stream, so you may need to first call Stream.Position := 0;
◼If
NativePixelFormat = True image will be returned in ie32RGB format with alpha in the
A channelvar
fs: TFileStream;
Begin
fs := TFileStream.Create('myfile.WebP', fmOpenRead);
if ImageEnView1.IO.LoadFromStreamWebP(fs) = False then
ShowMessage('Not a WebP file!');
fs.free;
End;
See Also
◼LoadFromFileWebP◼SaveToFileWebP