Here is one way to draw checked images horizontally at a specified dimension.
uses imageenview, iemio, imageenproc, ieview, iemview, iexBitmaps, hyiedefs, hyieutils;
procedure TForm1.DrawHorzontally1Click(Sender: TObject);
var
i: Integer;
iIndex: Integer;
iIEBitmapSource: TIEBitmap;
iCheckedCounter: Integer;
iBitmapSourceWidth: Integer;
iBitmapSourceHeight: Integer;
begin
Screen.Cursor := crHourGlass;
try
ImageEnView1.Clear;
// Create a TIEbitmap to hold the source image
iIEBitmapSource := TIEBitmap.Create;
try
iBitmapSourceWidth := 1024;
iBitmapSourceHeight := 768;
// Set the ImageEnView IEBitmap width to iBitmapSourceWidth * the number of checked images
ImageEnView1.IEBitmap.Width := iBitmapSourceWidth *
VerticalImageEnMView1.CheckedCount;
// Set the ImageEnView IEBitmap height
ImageEnView1.IEBitmap.Height := iBitmapSourceHeight;
{ Initialize iCheckedCounter value so we know where to draw the checked image }
iCheckedCounter := -1;
// Get the checked images and draw them to the ImageEnView IEBitmap
for i := 0 to VerticalImageEnMView1.ImageCount - 1 do
begin
if VerticalImageEnMView1.Checked[i] then
begin
{ Set the iCheckedCounter value }
Inc(iCheckedCounter);
// Load input file
VerticalImageEnMView1.CopyToIEBitmap(i, iIEBitmapSource);
// Resize iIEBitmapSource
iIEBitmapSource.Resample(iBitmapSourceWidth, iBitmapSourceHeight,
rfNone, True);
// Draw Source bitmap to ImageEnView Bitmap at the position of the
// iBitmapSourceHeight * iCheckedCounter Value
iIEBitmapSource.DrawToTIEBitmap(ImageEnView1.IEBitmap,
iBitmapSourceHeight * iCheckedCounter, 0);
end;
end;
// Update after drawing
ImageEnView1.Update;
// Free the iIEBitmapSource
finally
iIEBitmapSource.Free;
end;
finally
Screen.Cursor := crDefault;
end;
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development