Sorry, you are correct. I forgot that we made Assign() to be layer aware.
That is why this code fails:
procedure TMainForm.Button1Click(Sender: TObject);
var
iebmp: TIEBitmap;
begin
iebmp := TIEBitmap.Create;
try
ImageEnView1.Layers[ImageEnView1.LayersCurrent].CopyToBitmap(iebmp);
ImageEnView1.Assign(iebmp);
finally
iebmp.Free;
end;
ImageEnView1.Update;
end;
Because the call ImageEnView1.Assign(iebmp) is just assigning the bitmap back to ImageEnView1.LayersCurrent.Bitmap.
You need to set LayersCurrent to the background layer (0) before the assignment.
So this works:
var
iebmp: TIEBitmap;
begin
iebmp := TIEBitmap.Create;
try
ImageEnView1.CurrentLayer.CopyToBitmap(iebmp);
ImageEnView1.LayersCurrent := 0;
ImageEnView1.Assign(iebmp);
finally
iebmp.Free;
end;
end;
As does this:
ImageEnView1.Layers[0].Bitmap.Assign( ImageEnView1.CurrentLayer.Bitmap );
ImageEnView1.Update();
Nigel
Xequte Software
www.imageen.com