×
Namespaces

Variants
Actions

How to Create a Transparent Window

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: kamaljaiswal (10 Oct 2008)
Last edited: hamishwillee (23 Jul 2012)
Reviewer Approved    Thumbs up icon sm.jpg
 
void MyView::ConstructL()
{
CreateWindowL(); //
 
.........
}
 
void MyView::Draw(const TRect& aRect) const
{
// Get the standard graphics context
CWindowGc& gc = SystemGc();
 
TRgb b(255, 0, 0);
b.SetAlpha(100);
Window().SetTransparencyFactor(b);
// Gets the control's extent
TRect drawRect(Rect());
gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
gc.SetBrushColor(b);
 
// Clears the screen
gc.Clear(Rect());
 
}
This page was last modified on 23 July 2012, at 07:34.
45 page views in the last 30 days.