ImageEn, unit imageenio

TImageEnIO.LoadFromFileJpeg

TImageEnIO.LoadFromFileJpeg


Declaration

function LoadFromFileJpeg(const FileName: WideString): Boolean;


Description

Loads an image from a JPEG file. Result will be false if the file is not JPEG format (and Aborting will be true). Loading errors due to a file not being available will raise an exception.

FileName is the file name including extension.

Note: You can abort loading by setting Aborting to true


Example

ImageEnView1.IO.LoadFromFileJpeg('C:\alfa.jpg');

// Load a JPEG as fast as possible, ensuring width is >= 150 and height >= 100 (while maintaining the aspect ratio)
ImageEnView1.IO.Params.LoadToWidth  := 150;
ImageEnView1.IO.Params.LoadToHeight := 100;
ImageEnView1.IO.Params.JPEG_Scale := ioJPEG_AUTOCALC;
ImageEnView1.IO.LoadFromFileJpeg('C:\myimage.jpg');