ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Mask layer from selection

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
spetric Posted - Feb 09 2015 : 16:10:52
Hi,

I have background image in ImageEnView and I add a mask layer
that contains SelectionMask. After mask layer, I add another layer containg some image. All layers have the same size. Here is a code snippet:


imageContainer->PaintView->LockPaint();
if (imageContainer->PaintView->Selected)
   {
   TIEBitmap *map = new TIEBitmap;
   imageContainer->PaintView->SaveSelection();
   imageContainer->PaintView->VisibleSelection = false;
  imageContainer->PaintView->MakeSelectionFeather(SelFeather);
   imageContainer->PaintView->LayersAdd();
   imageContainer->PaintView->CurrentLayer->Visible = false;
   imageContainer->PaintView->CurrentLayer->IsMask = true;
   map->CopyFromTIEMask(imageContainer->PaintView->SelectionMask);
   imageContainer->PaintView->CurrentLayer->Bitmap->AssignImage(map);
   delete map;
   imageContainer->PaintView->MakeSelectionFeather(0);
   imageContainer->PaintView->RestoreSelection();
   imageContainer->PaintView->VisibleSelection = true;
   _maskLayerIndex = imageContainer->PaintView->LayersCurrent;
   }
imageContainer->PaintView->LayersAdd();
_imageLayerIndex = imageContainer->PaintView->LayersCurrent;
imageContainer->PaintView->CurrentLayer->Bitmap->AssignImage(imageContainer->ImageSidekick->ieBitmap);
imageContainer->PaintView->UnLockPaint();


However, upper layer is fully visible, when it's transparency is set to 255. Only when transparency is below 255 (or when operation is something other then normal) I get that check-board displayed in non-selected area.

I'm obviously doing something wrong.

2   L A T E S T    R E P L I E S    (Newest First)
spetric Posted - Feb 10 2015 : 02:35:12
Hi Nigel,

I've resolved the issue...the mask layer has wrong index:
When layer 0 is background image. layer 1 is mask, and layer 2 is another image, mask layer affects layer with lower index, not with higher one (I have misinterpreted meaning of upper layer in help).

I have reversed the order of layers creation and now it works as it should:
Layer 0 is background image, layer 1 is color image and layer 2 is mask and it affects layer 1.

xequte Posted - Feb 09 2015 : 21:02:14
Sorry Spectric, can you send me a demo, or give me more code and a few images to illustrate the issue.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com