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.