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
 Selecting layers
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

p0w3r

Norway
5 Posts

Posted - Jan 26 2014 :  07:25:09  Show Profile  Reply
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.

w2m

USA
1990 Posts

Posted - Jan 26 2014 :  07:42:53  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: