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
 LayersMerge now working propely....
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Aug 01 2018 :  07:34:54  Show Profile  Reply
Hello,

I am using this code to add selection to mask layer. This code was wrking properly in version 7.5 but not working in 8.x.
if not ImageEnView1.Selected then
    exit;

  ImageEnView1.LayersCurrent := 1;
  idx := ImageEnView1.LayersCreateFromSelection;
  ImageEnView1.Deselect;

  ImageEnView1.Proc.HistAutoEqualize();
  ImageEnView1.Proc.Negative;
  ImageEnView1.Proc.ConvertToGray;
  ImageEnView1.CurrentLayer.Operation := TIERenderOperation(4);

  ImageEnView1.LayersMerge(1,idx, True);


Here is a test project that will show problem.

attach/yogiyang/2018817316_MaskProblem.zip
54.07 KB

To test in the sample:
  • Load an Image/Photo
  • Select an area
  • Click on button: Create Mask From Selection
  • Once the loaded image/photo is masked
  • Select something outside of the visible mask area
  • Click on button: Add Selection To Mask


TIA


Yogi Yang

xequte

39053 Posts

Posted - Aug 03 2018 :  00:45:37  Show Profile  Reply
Hi Yogi

You are merging 8bit mask with a 24bit image, which is not possible. Please adjust it as follows:

  ImageEnView1.Layers[1].Bitmap.PixelFormat := ie24rgb;
  ImageEnView1.Layers[1].IsMask := False;
  ImageEnView1.LayersMerge(1, 2, True);
  ImageEnView1.Layers[1].IsMask := True;
  ImageEnView1.Layers[1].Visible := False;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
727 Posts

Posted - Aug 03 2018 :  06:20:47  Show Profile  Reply
Hello Nigel,

Thanks for the solution.

I have already worked out my own solution to this problem.

I posted it here to bring it to your notice.

But this was working in older version of IE so I posted here.

TIA


Yogi Yang
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: