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
 Selection - question
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

graph_man

328 Posts

Posted - Apr 10 2017 :  17:30:52  Show Profile  Reply
How to select only areas where all pixels are inside selected area?

See example video:
https://www.dropbox.com/s/lxevkx41bsfahep/selection-example.mp4?dl=0

xequte

38610 Posts

Posted - Apr 10 2017 :  19:41:49  Show Profile  Reply
Hi

That would be cool, but there is no feature for that.

You could probably do it by:
- Copying the selection into a bitmap
- Ensuring the bitmap is monochrome
- Filling any parts of the bitmap that touch the sides
- Copying the bitmap to the selection mask:

https://www.imageen.com/help/TImageEnView.SelectionMask.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

graph_man

328 Posts

Posted - Apr 10 2017 :  20:26:24  Show Profile  Reply
Thank you.
Go to Top of Page

graph_man

328 Posts

Posted - Apr 19 2017 :  19:29:52  Show Profile  Reply
- Copying the selection into a bitmap
- Ensuring the bitmap is monochrome
- Filling any parts of the bitmap that touch the sides

All is OK

- Copying the bitmap to the selection mask:

I don't see result after:
ImageEnView1->DeSelect();
SelectionBitmap1->CopyToTIEMask(ImageEnView1->SelectionMask);
ImageEnView1->SelectCustom();

Go to Top of Page

xequte

38610 Posts

Posted - Apr 20 2017 :  02:12:48  Show Profile  Reply
How about if you use:

ImageEnView1.SelectionMask.Assign( SelectionBitmap1 );
ImageEnView1.SelectCustom();


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

graph_man

328 Posts

Posted - Apr 20 2017 :  06:24:24  Show Profile  Reply
In this case corrected selection stretched to the whole image.
Go to Top of Page

xequte

38610 Posts

Posted - Apr 21 2017 :  15:48:27  Show Profile  Reply
Hi

The selection mask should be the same size as the whole image anyway...

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

graph_man

328 Posts

Posted - Apr 21 2017 :  15:49:21  Show Profile  Reply
Why I cannot use

SelectionBitmap1->CopyToTIEMask(ImageEnView1->SelectionMask);

???
Go to Top of Page

graph_man

328 Posts

Posted - Apr 21 2017 :  15:58:16  Show Profile  Reply
My bitmap is smaller than the whole image.

I use

ImageEnView1->CopySelectionToIEBitmap(SelectionBitmap1);
Go to Top of Page

xequte

38610 Posts

Posted - Apr 23 2017 :  15:57:00  Show Profile  Reply
Hi

I'm out of the office this week, so I cannot look at the code to confirm the difference. Perhaps your SelectionBitmap1 is not ie1g pixel format.

At any rate, CopyToTIEMask fills the entire mask, so it won't allow you to copy just a portion of the image. To do that use an intermediary TIEBitmap copy the portion to the whole "Selection Bitmap" and then assign the "selection bitmap" to the SelectionMask.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

graph_man

328 Posts

Posted - Apr 23 2017 :  16:41:03  Show Profile  Reply
thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: