|
||
Transparent
: Drawing Transparent
Windows
This example application demonstrates how to implement the following
window server features using the RWindow::BeginRedraw()
and RWindow::EndRedraw()
functions:
creating transparent, non-transparent and blank windows,
changing the transparency of a window,
drawing content on a window.
This example is located in the
examples\Graphics\WS\transparent
folder. The following sections
provide more information about this example application.
This example creates a blank window on which a background and a
foreground window are drawn. The blank window is constructed using the
RBlankWindow
class. The CPeriodic
class triggers periodic redraws on the window. The following functions are used
to re-draw content on the window:
RWindow::Activate()
The transparency of the foreground window is changed using the following functions:
RWindow::SetTransparencyFactor()
:
The transparency factor of the foreground window is incremented from 0 to 255
(transparent to opaque) using this function.
RWindow::SetTransparentRegion()
:
The transparent region is moved on the foreground window by changing the offset
of the transparent region using this function.
RWindow::SetTransparencyBitmap()
:
The transparency bitmap of the transparent window is changed based on the
bitmap mask using this function. This bitmap mask is created using the
CFbsBitmap
class. The bitmap mask contains some content
drawn on it using the CBitmapDevice
and
CBitmapGc
classes.
The user-defined class CEventHandler
handles
pointer events when transparent areas of the window are clicked on by the
pointer device. An appropriate message is displayed when a click
event is detected.
The following principal classes are used in this example application:
The Symbian OS build process describes how to build this example.
The Transparent
builds an executable called
transparent.exe
in the standard location
(\epoc32\release\winscw\<build_variant>
for Carbide).