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
 Selecting layers

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
p0w3r Posted - Jan 26 2014 : 07:25:09
Hi,
I want to show/hide layers when I click on them but I'm not being able to do this correctly as I am only getting the square bounds of them.
How can I know if the pixel I click belongs or not to a certain layer?
Thanks in advance.
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jan 26 2014 : 07:42:53
You can determine the layer number in the OnLayerNotify event or by getting the current layer number from LayersCurrent.
procedure TForm1.ImageEnView1LayerNotify(Sender: TObject; layer: integer;
event: TIELayerEvent);
{ ImageEnView layer notify. }
begin
  if event = ielSelected then
  begin
    { Show the current layer number }
    ShowMessage('The current layer is ' + IntToStr(layer) + '.');
  end;
end;

procedure TForm1.ImageEnView1Click(Sender: TObject);
var
  i: integer;
begin
  { Show the current layer number }
  i := ImageEnView1.LayersCurrent;
  ShowMessage('The current layer is ' + IntToStr(i) + '.');
end;

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html