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
 If then in imageen
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aftereffectniko

Ethiopia
23 Posts

Posted - Jun 17 2013 :  13:52:19  Show Profile  Reply
How to write If layer 1 exist then delete layer 1 else close the progarme

w2m

USA
1990 Posts

Posted - Jun 17 2013 :  16:00:20  Show Profile  Reply
procedure TForm1.Button1Click(Sender: TObject);
begin
 { Layer 0 is the background and is always present 
   so if LayersCount = 2 then there is a background
   layer (0) and a "true" layer (1) }
 if ImageEnView1.LayersCount = 2 then
   ImageEnView1.LayersRemove(1)
 else
   Close;
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: