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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Changing the alpha of the complete layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

BionicWave

Germany
33 Posts

Posted - Mar 31 2012 :  03:04:23  Show Profile  Reply
Say i have a pile of images as different layers.
In another component you can see the images that are piled up as
a list. Whenever i click on an image in the list i want to
- Make this image the toplayer of the TImageEnView.
- Change the alpha of the selected layer to non-transparent
- Change the alpha of all non-selected layers to a specific
transparency.

My questions are:
1) Can i move a layer to be a top-layer?
2) Can i change a layer to be transparent or not?


thanks for your help

w2m

USA
1990 Posts

Posted - Mar 31 2012 :  05:32:00  Show Profile  Reply

Set the LayersCurrent to the selected index to make a layer the top layer. Change all layers transparency to specific transparency... say 100. Set the selected or top layer transparency to 255 or non-transparent. Using the demo in Samples\ImageProcessing1\
Layers try this:

procedure Tfmain.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
var
i: integer;
begin
  // make all layers transparency 100
  for i := 0 to ImageEnView1.LayersCount - 1 do
    ImageEnView1.Layers[i].Transparency := 100;
  // make selected layer the top layer
  ImageEnView1.LayersCurrent := idx;
  // make current layer transparency 255
  with ImageEnView1 do
  begin
    CurrentLayer.Transparency := 255;
    RefreshControls;
  end;
end;


William Miller
Go to Top of Page

BionicWave

Germany
33 Posts

Posted - Apr 01 2012 :  07:46:40  Show Profile  Reply
Omg....
This easy?
Lol, i thought it would be more complicated to do so.
Many thanks for answering me.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: