CreateButtonGroup

function CreateButtonGroup(layeredImage32: TLayeredImage32; const buttonPts: TArrayOfPointD; buttonColor: TColor32; buttonSize: integer; buttonOptions: TButtonOptions; buttonLayerClass: TButtonDesignerLayer32Class = nil): integer;


Creates a designer button layer for each coordinate in 'buttonPts'. These button will be topmost of current layers, so once these button layers have been created, the last button in the group will be targetLayer.owner.TopLayer.

The returned integer value is the new button group's GroupId, otherwise 0 if there was an error creating the group.

From Examples/Transform

procedure TForm1.ResetSpline;
begin
  //remove any existing buttons (layers)
  if fButtonGroupId > 0 then
  begin
    layeredImage32.DeleteGroup(fButtonGroupId);
    fButtonGroupId := 0;
  end;

  fTransformType := ttSpline;
  with masterLayer.Image do
    fPts := MakePathI([0,0, Width div 2,0, Width,0]);
  fPts := OffsetPath(fPts, fMargin, fMargin);

  fButtonGroupId := CreateButtonGroup(layeredImage32, 
    fPts, clGreen32, DefaultButtonSize, [boDropShadow]);
end;
    

See Also

TButtonOptions