I have a problem when I'm trying to do a popup window, that shows on top
of every application in a certain point of the screen (i.e. on top of every
application, no matter if user switches it). This works just fine, but the
real problem is when I'm trying to draw an icon with a mask to the window
and I can't get it to be transparent, no matter how hard I try.
I personally suspect, that it might have something to do with that new window
creation, that it creates a window that is not transparent or something, since
the icons created from the same .svg work perfectly fine with transparencies in
all other places in of the software (the same icon is being used as an application
icon, and in one information note etc. and the transparency works just fine)
.I have also tried to create same kind of icon from bitmaps, but the effect is
just the same, white background for the icon without any transparency.
The masks are correct in both of the cases (with icons created from .svg's or from .bmp's.)
Does anyone have a clue, what might be wrong in the following code?
Here's some code snippets, which I use to show the popup icon:
(the class has been derived from CCoeControl, and the AppUi creates it with NewL and
by calling the SetIndicatorIcon() )
--- Code for constructing the control:
// These are for showing the icon on top of every other applications!
iMyWindowGroup = RWindowGroup(iCoeEnv->WsSession());
// Same thing with bitmaps, it just won't become transparent :(
iIndicator = CEikonEnv::Static()->CreateBitmapL(path, 0);
iIndicatorMask = CEikonEnv::Static()->CreateBitmapL(path, 1);
// Load icons from mif-file
// Icon with makefile created mask
AknIconUtils::CreateIconL(iIndicator, iIndicatorMask, mifFile,
AknIconUtils::SetSize(iIndicator, TSize(20, 20), EAspectRatioPreserved);
AknIconUtils::SetSize(iIndicatorMask, TSize(20, 20), EAspectRatioPreserved);
// Make the window transparent
// TODO None of these won't work!!
Window().SetBackgroundColor( TRgb( 0x11111111,0 ) );
Window().SetTransparencyBitmap( *iIndicatorMask );
--- This method is called, when the icon should be drawed on to the screen.
--- Drawing method
void CIndicatorIcon::SetIndicatorIconL( const TRect& aRect, TBool aRedraw)
TInt PosX = KIndicatorPosX;
TInt PosY = KIndicatorPosY;
// if aRedraw == ETrue just draw the canvas again.
-- And here's a snippet, that shows how the .svg files are being converted (from icons.mk)
void CIndicatorIcon::Draw(const TRect& aRect) const
CWindowGc& gc = SystemGc();
gc.SetPenStyle( CGraphicsContext::ENullPen );
// ODDITY: Changing the invert mask parameter does not seem to
// affect anyway!!
TRect(TPoint(0, 0), iIndicator->SizeInPixels()),
// TEST: The mask seems to be just how it should be..
//gc.BitBlt(TPoint(aRect.iTl.iX, aRect.iTl.iY), iIndicatorMask );
mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \