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
 Layers grouping

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 - Sep 07 2012 : 05:51:27
Is there any way by which we can group or link multiple layers in ImageEN so that when a user selectes one of the layer and mover it all the layers that are part of the group should also move....

TIA

Yogi Yang


Yogi Yang
8   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Nov 07 2012 : 07:14:46
This is to update Klaus & William,

The last code that I got from Klaus works like a charm with a few modifications. I say modifications as I had no need to affect all layers. All that I wanted to achieve is to resize and/or move the current layer and the layer above it if it is a Mask layer.

Once more thank you both for the code samples.


Yogi Yang
yogiyang Posted - Sep 13 2012 : 06:36:42
@Klaus & William,

Thank you both for your help.

I will play with the code and if necessary post here for help.

Regards,

Yogi Yang


Yogi Yang
w2m Posted - Sep 13 2012 : 06:20:36
Good Job Klaus... It works perfectly.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
klausdoege Posted - Sep 13 2012 : 05:27:39
William,
sorry it was a simple solution.
Here an improved version.
If pressed left Shift button, all Layer are postponed.
I hope this is useful.
----------------------------------------------
var la:array of tpoint;
lasx,lasty:integer;
procedure TMDIChild.ImageEnVectLayerNotify(Sender: TObject; layer: Integer;
event: TIELayerEvent);
var l, divX, divY :integer;
begin
// Beispiel for Yogi Yang
if event=ielSelected then
begin
// we set the array length
setlength(la,imageenvect.LayersCount);
// we notice the position of all layers
for l:= 0 to imageenvect.LayersCount-1 do
begin
la[l].X:=imageenvect.Layers[l].PosX;
la[l].Y:=imageenvect.Layers[l].PosY;
end;
// this is the last position of the current and move Layer
lastX:=imageenvect.CurrentLayer.PosX;
lastY:=imageenvect.CurrentLayer.PosY;
end;
// when we pressed the left Shiftbutton, then we move all layers
// VK_LSHIFT, VK_RSHIFT, VK_LCONTROL, VK_RCONTROL, VK_LMENU, VK_RMENU
// are posible
if (event=ielMoving) and (getkeystate(vk_lshift)<0) then
begin
// we calculate the difference
divX:=imageenvect.CurrentLayer.PosX-lastX;
divY:=imageenvect.CurrentLayer.PosY-lastY;
// l:=1 .. without layer0
for l:= 1 to imageenvect.LayersCount-1 do
begin
// is not currentlayer then move the layer
if l<>Layer then
begin
imageenvect.Layers[l].PosX:=la[l].X+divX;
imageenvect.Layers[l].PosY:=la[l].Y+divY;
end;
end;
end;

Klaus
www.klausdoege.de
w2m Posted - Sep 12 2012 : 17:06:44
Klaus,

Your code allows moving all the layers but each layer is positioned with the same XY value. I tied to accomplish this for a couple of hours and almost got it to work as you would ecpect but I could not get it perfect so I gave up. Tip, you have to get the origional position of the selected layer in the ImageEnView1LayerNotify event = ielSelected, then adjust the position of each layer (except the current layer) by the distance (XY) the selected layer is moved in the (event = ielMoving) or (event = ielMoved), The distance X can be a positive number if the layers position is >= selected layers position X and negative if the layers position is < selected layers position.

Then do the same for Y positions.

I'll try to get it to work once more but it is not easy... Additional hint: the origional layer position, the distance between the selected layer and the other layers have to be stored in a global variables.

It would be much better if this were done at the component level rather than at the application level. The user could toggle a multiselectlayers property then select each layer by selecting it or by selecting an area around the layers with the mouse.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
klausdoege Posted - Sep 12 2012 : 14:36:16
Hello Yogi Yang,
here is a small example as you can move all layers.
Use the procedure
TMDIChild.ImageEnVectLayerNotify(Sender: TObject; layer: Integer; event: TIELayerEvent);
I hope it helps you.

procedure TMDIChild.ImageEnVectLayerNotify(Sender: TObject; layer: Integer;
event: TIELayerEvent);
var l:integer;
begin
for l:= 1 to activechild.imageenvect.LayersCount-1 do
begin
if l<>activechild.imageenvect.LayersCurrent then
begin
activechild.imageenvect.Layers[a].PosX:=activechild.imageenvect.CurrentLayer.PosX;
activechild.imageenvect.Layers[a].PosY:=activechild.imageenvect.CurrentLayer.PosY;
end;
end;
end;

Klaus
www.klausdoege.de
yogiyang Posted - Sep 12 2012 : 06:52:47
Ok that is fine that there is not function for such functionality.

but, can you give me some logical way by which I can achieve this by programming. I am still fumbling to get such functionality programmed but I am not able to achieve any results.

TIA

Yogi Yang


Yogi Yang
xequte Posted - Sep 08 2012 : 18:31:43
Hi

I'm afraid there is not a function to do that at present.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com