ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to resize a group of layers programmatically?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yogiyang Posted - Jun 03 2016 : 08:59:33
Hello,

There is facility to select multiple layers and group them.

Is there a way to resize, rotate, etc. the whole group programmatically?

TIA


Yogi Yang
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 18 2016 : 20:25:17
Thanks,

I've added ScalePosition as a parameter in v6.3.1.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
harry stahl Posted - Jul 17 2016 : 16:21:22
One Remark to LayersSizeAll. When I have the following Photoshop-Layerfile:



And after using "ImageEnView1.LayersSizeAll(scaleX, ScaleY, false, True);" (where ScaleX and ScaleY = 0.5):



The Sizes are OK, but the layers are on the wrong positions.

I have this solution for me, that works (Resizing all Layers):

  ImageEnView1.LockUpdate;
  for i := 0 to ImageEnView1.LayersCount - 1 do
    begin
      ImageEnView1.Layers[i].Width := round (ImageEnView1.Layers[i].Width * ScaleX);
      ImageEnView1.Layers[i].Height := round (ImageEnView1.Layers[i].Height * ScaleY);

      ImageEnView1.Layers[i].PosX := Round (ImageEnView1.Layers[i].posx * ScaleX);
      ImageEnView1.Layers[i].PosY := round (ImageEnView1.Layers[i].posy * ScaleY);

      if i = 0 then ImageEnView1.LayersFixSizes(i);
    end;
    ImageEnView1.UnlockUpdate;
    ImageEnview1.Update;


Perhaps could this be optimized / fixed in the next update.

HS
xequte Posted - Jun 04 2016 : 17:05:46
Hi

Breaking changes between 6.2.2 and 6.3.0 were minimal (affecting certain undo/redo calls):

http://www.imageen.com/help/Updating%20and%20Compatibility.html

So can you give us more detail of your problems with v6.3.0?


You can see documentation for the methods that Bill mentions at:

http://www.imageen.com/help/TImageEnView.html


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Jun 04 2016 : 11:12:06
Put the cursor on LayersSizeAll... ImageEnView1.LayersSizeAll(0.5, 0.5); then right click to popup a menu then select Find Declaration. The help information will be located just before the procedure or function in the source code. This means your help file is not current. Update your help file.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
yogiyang Posted - Jun 04 2016 : 01:18:38
Hello Bill,

Thank you for the code sample.

But I am not able to find any documentation on function/procedures you have used in your code like for example: LayersSizeAll

Another thing I am using IE 6.2.1 as I am not able to compile our flagship product in 6.3.0 for some unknown reasons.

Tia


Yogi Yang
w2m Posted - Jun 03 2016 : 10:05:17
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