ImageEn, unit iexBitmaps

IEShowImagePreview


Declaration

procedure IEShowImagePreview(const Filename: string; const Caption: string = '';
                             AutoShrink: Boolean = true; AutoStretch: Boolean = False;
                             PreviewWidth: Integer = -1; PreviewHeight: Integer = -1;
                             Maximized: Boolean = False); overload;
procedure IEShowImagePreview(Bmp: TIEBitmap; const Caption: string = '';
                             AutoShrink: Boolean = true; AutoStretch: Boolean = False;
                             PreviewWidth: Integer = -1; PreviewHeight: Integer = -1;
                             Maximized: Boolean = False); overload;


Description

Display a pop-up window to show an image.

Parameter Description
Filename/Bmp The image to display
Caption The heading for the window (defaults to the image filename)
AutoShrink If true, large images will be shrunk to the window size
AutoStretch If true, small images will be stretched to the window size
PreviewWidth, PreviewHeight The size of the display window. If -1 it will be made the same as the image (though it will be shrunk to ensure it is no larger than the screen)
Maximized Set to true to display the window in a maximized state

Note:
 User can hide the dialog by clicking Esc or clicking the [x] button
 An exception will be raised if any invalid filename is specified (e.g. not an image)
 A simple pop-up menu is available to zoom or print the image
 You can also show image info using IEShowImageInfo


Demo

Demo  Demos\InputOutput\BatchConvert\BatchConvert.dpr


Examples

IEShowImagePreview( 'D:\Image.jpg' );

// Show a maximized preview at 100% zoom
IEShowImagePreview( 'D:\Image.png', 'Preview Image', False, False, -1, -1, True );

// Show preview of the current image in a TImageEnMView
bmp := ImageEnMView1.IEBitmap;
if bmp <> nil then
  IEShowImagePreview( bmp, '', fAutoShrink, fAutoStretch, -1, -1, fMaximized );