ImageEn, unit iexHelperFunctions

TIEBitmapHelper.ReadEx

TIEBitmapHelper.ReadEx


Declaration

// File overload
function ReadEx(const Filename : string; IOParams: TIOParams = nil; ImageIndex: Integer = 0): Boolean; overload;

// File Fast Loading overload
function ReadEx(const Filename: string;
                MaxX, MaxY: integer;
                AutoAdjustOrientation: Boolean = False;
                IOParams: TIOParams = nil
                ): Boolean; overload;

// Stream overload
function ReadEx(Stream: TStream; FileType: TIOFileType = ioUnknown; IOParams: TIOParams = nil; ImageIndex: Integer = 0): Boolean; overload;

// Stream Fast Loading overload
function ReadEx(Stream: TStream;
                FileType: TIOFileType;
                MaxX, MaxY: integer;
                AutoAdjustOrientation: Boolean = False;
                IOParams: TIOParams = nil
                ): Boolean; overload;


Description

Allows a TIEBitmap to load any format supported by ImageEn.
You can optionally pass an TIOParams object for the I/O parameters of the file. The index of an image to load within a multiframe format can also be specified.
The fast overload allows you to load much faster by specifying the maximum size it is required. It uses OptimizeLoadingParams and WicFastLoading.
You can also set EnableAdjustOrientation to automatically re-orient JPEG camera images.
For the stream overloads, if you know the FileType type of the stream, pass it to speed up loading.
Returns True if loading was successful, or False on error.

Note:
Unlike LoadFromFile, ReadEx will use TIEWicReader for better performance where possible
You must add the iexHelperFunctions unit to your uses clause


Examples

// Load the image specified in an open dialog
ImageEnView1.IEBitmap.ReadEx(OpenPictureDialog1.FileName);

// Load the specified image as fast as possible, but bigger than the screen dimensions
MyIEBitmap.ReadEx('D:\MyImage.jpeg', Screen.Width, Screen.Height);

// Load the specified image as fast as possible, but bigger than the screen dimensions
MyIEBitmap.ReadEx( MyStream, ioUnknown, Screen.Width, Screen.Height );


Compatibility Information

Prior to v12.0.0, ReadEx was named: IELoadFromFile(), IELoadFromFileFast(), IELoadFromStream(), IELoadFromStreamFast()