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
 Mask with selection
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ali_reza_nazari

Canada
10 Posts

Posted - Mar 13 2019 :  09:31:41  Show Profile  Reply
Hi.
i want to select a region and then when i click on a button,
selected are show and not selected area not show and be black

i first run this code

ImageEnView1.IO.LoadFromFileJpeg('C:\1.jpg');


Then select a region on ImageEnView
and finally click on button a run this code


 if not ImageEnView1.Selected then exit;
 if ImageEnView1.LayersCount <> 2 then ImageEnView1.LayersInsert( 
  ImageEnView1.LayersCurrent + 1, ielkImage );

  ImageEnView1.InvertSelection;
  ImageEnView1.proc.Fill(Clblack);
  ImageEnView1.InvertSelection;
  ImageEnView1.proc.Fill(Clwhite);
  TIEImageLayer( ImageEnView1.CurrentLayer ).Bitmap.PixelFormat := ie8g;
  ImageEnView1.CurrentLayer.IsMask := True;
  ImageEnView1.Layers[1].IsMask := true;



Selected are is white and outside is black
but only show an black/white image and
masked image not showed

thanks


Dr.
IA Computer

ali_reza_nazari

Canada
10 Posts

Posted - Mar 13 2019 :  10:12:30  Show Profile  Reply
Hi again

i add this code to second code
it work fine

ImageEnView1.CurrentLayer.Visible := False;



Dr.
IA Computer
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: