Hi
You should find it easier to start with a transparent background and merge your images with that:
procedure TfmMain.CreateTiledImage;
const
ncols = 3;
nrows = 3;
var
col : integer;
row : integer;
xpos : integer;
ypos : integer;
path : string;
url : string;
ABitmap: TIEBitmap;
begin
Screen.Cursor := crHourGlass;
ABitmap := TIEBitmap.create;
try
ImageEnView1.LegacyBitmap := False;
ImageEnView1.IEBitmap.Width := 3*256;
ImageEnView1.IEBitmap.Height := 3*256;
ImageEnView1.EnableAlphaChannel := True;
ImageEnView1.AlphaChannel.Fill(0);
ypos := 0;
for row := 0 to 2 do
begin
xpos := 0;
for col := 0 to 2 do
begin
path := Format('Image%d%d.png',[col,row]);
ABitmap.Read(path);
ImageEnView1.IEBitmap.MergeWithAlpha(ABitmap, xpos, ypos);
inc(xpos, 256);
end;
inc(ypos,256);
end;
ImageEnView1.Update;
if ImageEnView1.HasAlphaChannel = False then
raise Exception.create('No Alpha channel!');
ImageEnView1.IO.SaveToFilePNG('Image.png');
finally
Screen.Cursor := crDefault;
ABitmap.free;
end;
end;
Nigel
Xequte Software
www.xequte.com
nigel@xequte.com