procedure TForm1.MultipleLayerSelection1Click(Sender: TObject);
{ Toggle selecting multiple layers }
begin
if MultipleLayerSelection1.Checked then
ImageEnView1.LayerOptions := ImageEnView1.LayerOptions +
[loAllowMultiSelect]
else
ImageEnView1.LayerOptions := ImageEnView1.LayerOptions -
[loAllowMultiSelect];
end;
procedure TForm1.GroupLayers1Click(Sender: TObject);
{ Toggle Grouping Layers }
begin
if GroupLayers1.Down then
begin
ImageEnView1.LayersGroup(true);
ImageEnView1.LayersDeselectAll;
Layers1.ItemIndex := 0;
GroupLayers1.Caption := 'Ungroup Layers';
end
else
begin
ImageEnView1.LayersUngroup();
ImageEnView1.LayersDeselectAll;
Layers1.ItemIndex := 0;
GroupLayers1.Caption := 'Group Layers';
end;
end;
procedure TForm1.ResizeAllLayers1Click(Sender: TObject);
{ Resize all selected layers }
begin
{Halve the size of all layers}
ImageEnView1.LayersSizeAll(0.5, 0.5);
end;
procedure TForm1.RotateAllLayers1Click(Sender: TObject);
{ Rotate all selected layers }
begin
{Rotate all layers 45° clockwise}
ImageEnView1.LayersRotateAll(315);
end;
procedure TForm1.ResizeSelectedLayers1Click(Sender: TObject);
{ Resize all selected layers }
var
i: Integer;
begin
ImageEnView1.LockUpdate;
for i := 0 to ImageEnView1.LayersCount - 1 do
if ImageEnView1.Layers[i].Selected then
begin
ImageEnView1.Layers[i].Width := ImageEnView1.Layers[i].Width div 2;
ImageEnView1.Layers[i].Height := ImageEnView1.Layers[i].Height div 2;
ImageEnView1.LayersFixSizes(i);
end;
ImageEnView1.UnlockUpdate;
end;
procedure TForm1.RotateSelectedLayers1Click(Sender: TObject);
{ Rotate all selected layers }
var
i: Integer;
begin
ImageEnView1.LockUpdate;
for i := 0 to ImageEnView1.LayersCount - 1 do
if ImageEnView1.Layers[i].Selected then
ImageEnView1.Layers[i].Rotate := 90;
ImageEnView1.LayersFixRotations(LYR_SELECTED_LAYERS);
ImageEnView1.UnlockUpdate;
end;
1. Add a background image
2. Add two layers
3. Click MultipleLayerSelection1 checkbox
4. Click GroupLayers1 SpeedButton
5. Select ResizeAllLayers1 button or select RotateAllLayers1 button or select ResizeSelectedLayers1 button or select RotateSelectedLayers1 button
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development