// The Line-Layer is added by this code:
// PS: The line is drawn diagonal.
Procedure TMainForm.DrawLineClick(Sender: TObject);
begin
ImageEnView1.LayerDefaults.Add(IELP_LineEndShape + ' = ' + IntToStr(ord(ieesNone)));
ImageEnView1.MouseInteract := [miClickCreateLineLayers, miMoveLayers, miResizeLayers];
end;
// The Image-Layer (*.png in color) is added by this code:
procedure TMainForm.AddImageClick(Sender: TObject);
var idx : Integer;
bmp : TIEBitmap;
begin
idx := (Sender AS TdxBarLargeButton).ImageIndex;
if idx >= 0 then
begin
bmp := ImageEnMView2.GetTIEBitmap(idx);
ImageEnView1.LayersAdd(bmp);
// Position Image-Layer in the center of mouseclick.
ImageEnView1.CurrentLayer.PosX := Round(ImageEnView1.ClientWidth / 2);
ImageEnView1.CurrentLayer.PosY := Round(ImageEnView1.ClientHeight / 2);
ImageEnView1.CurrentLayer.BorderColor := clNone;
ImageEnMView2.ReleaseBitmap(idx, False);
end;
ClearMouseActions;
ImageEnView1.Update();
end;
// Button to select layers
Procedure TMainForm.SelectLayerClick(Sender: TObject);
begin
ClearMouseActions;
end;
// After drawing MouseInteract is set to:
procedure TMainForm.ClearMouseActions;
begin
ImageEnView1.MouseInteract := [miZoom, miMovingScroll, miEditLayerPoints, miMoveLayers, miResizeLayers, miRotateLayers];
end;
In your demos, selecting and dragging only seems to work when the Image-Layer is placed on top of the Line-Layer.
In my example the Image-Layer can always be selected (through the transparent part of the Line-Layer, but I can't drag it. The moment I drag it it will select the Line-Layer.