I've tried the following:
procedure TForm1.mTransformToImageLayerClick(Sender: TObject);
var
NewLayerIndex: Integer;
begin
with ImageEnView1 do
begin
// Add a new image layer:
NewLayerIndex := LayersAdd(ielkImage, 0, 0, IEBitmap.Width, IEBitmap.Height);
// Assign the background image to the new image layer:
Layers[NewLayerIndex].Bitmap.Assign(IEBitmap);
// Clear the original background image:
ImageEnView1.IEBitmap.Clear;
// Set the properties of the new layer, including transparency
with Layers[NewLayerIndex] do // Index is now NewLayerIndex - 1 because we deleted a layer
begin
Opacity := 128; // Adjust transparency (0: fully transparent, 255: fully opaque)
Selectable := True;
Visible := True;
VisibleBox := True;
ResampleFilter := rfLanczos3;
AntiAlias := True;
AspectRatioLocked := True;
end;
// Update the view
Update;
end;
end;
But as soon as I resize the new Layer with the mouse, its layer grips vanish (while the original image remains visible).