All you have to do is depending on the number of layers is to position and set the dimensions of each layer accordingly.
The following code creates a 3 image layout as you specified. You will have to modify this to create other layouts.
Only you can do this because only you know what the layouts should look like.
This code does not attempt to determine the orientation, it merely shows how to show the layers as you indicated in your post.
You can determine the orientation by comparing the IEBitmap.Width and IEBitmap.Height and adjust the code accordingly.
procedure TForm1.Preview1Click(Sender: TObject);
var
i: Integer;
iCount: Integer;
iLayer: Integer;
iMidPointX: Integer;
iMidPointY: Integer;
iWidth: Integer;
iHeight: Integer;
iMarginX: Integer;
iMarginY: Integer;
iZoom: Double;
begin
iCount := ImageEnMView1.ImageCount;
if iCount > 0 then
begin
ImageEnView1.Proc.ImageResize(1024, 768);
ImageEnView1.Proc.Fill(clWhite);
iWidth := ImageEnView1.Layers[0].Width;
iHeight := ImageEnView1.Layers[0].Height;
iMarginX := 10;
iMarginY := 10;
iMidPointX := iWidth div 2;
iMidPointY := iHeight div 2;
iCount := ImageEnMView1.ImageCount;
iZoom := ImageEnView1.Zoom;
for i := 1 to iCount do
begin
iLayer := ImageEnView1.LayersAdd;
ImageEnMView1.CopyToIEBitmap(iLayer - 1, ImageEnView1.IEBitmap);
ImageEnView1.Update;
ImageEnView1.Layers[iLayer].Name := 'Image Layer ' + IntToStr(i);
if i = 1 then
begin
ImageEnView1.Layers[iLayer].PosX := iMarginX;
ImageEnView1.Layers[iLayer].PosY := iMarginY;
ImageEnView1.Layers[iLayer].Width := iMidPointX - iMarginX * 2;
ImageEnView1.Layers[iLayer].Height := iMidPointY - iMarginY;
end;
if i = 2 then
begin
ImageEnView1.Layers[iLayer].Width := iMidPointX - iMarginX * 2;
ImageEnView1.Layers[iLayer].Height := iMidPointY - iMarginY * 2;
ImageEnView1.Layers[iLayer].PosX := iMarginX;
ImageEnView1.Layers[iLayer].PosY := iMidPointY + iMarginY;
end;
if i = 3 then
begin
ImageEnView1.Layers[iLayer].PosX := iMidPointX;
ImageEnView1.Layers[iLayer].PosY := iMarginY;
ImageEnView1.Layers[iLayer].Width := iMidPointX - iMarginX;
ImageEnView1.Layers[iLayer].Height := iHeight - iMarginY * 2;
end;
ImageEnView1.Update;
end;
end;
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development