There are several ways to do this with ImageEn, but if you are using JPEG files then probably this is the best:
TImageEnIO.LoadFromFileJPEGFast
Declaration
function LoadFromFileJPEGFast(const sFilename: string;
iMaxX, iMaxY: integer;
var iFastScaleUsed: Integer;
bAutoAdjustOrientation: Boolean = False
): boolean;
Description
Calls LoadFromFileJpeg to load a JPEG image and allows you to specify a maximum size that you require an image so that it can be loaded as fast as possible, by using JPEG_Scale.
You can also set EnableAdjustOrientation to automatically re-orient JPEG camera images.
Returns True if loading was successful, or False on error. iFastScaleUsed is set with the scaling that was used, i.e. 1 = loaded full size, 2 = loaded at half size, etc.
uses IEHelperFunctions;
begin
{ Load a jpeg file with dimensions of 640x427 and rotate the
image }
ImageEnView1.IO.LoadFromFileFast(OpenPictureDialog1.FileName, 640,
427, False, True);
{ Sharpen the image "slightly"}
ImageEnView.Proc.AutoSharp(5);
end;
Alternative
var
iAdjustment: integer;
begin
ImageEnView1.IO.LoadFromFile(OpenPictureDialog1.FileName);
ImageEnView1.Proc.Resample(640, 427, rfNone);
{ Auto Adjust }
iAdjustment:= ImageEnView1.Proc.CalcOrientation;
ImageEnView.Proc.Rotate(iAdjustment);
{ Sharpen the image "slightly"}
ImageEnView.Proc.AutoSharp(5);
end;
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html