|
From: Giuseppe J. C. <msj...@ho...> - 2008-12-12 02:16:55
|
Hi all,
While getting ready for the upcoming Xmas holidays ....
I am writing an application that collects video from network cameras and displays the content via a "Graphic" control, I would also like to display additional information over the images (i.e. Date and Time etc. etc.).
To achieve my goal I am using a second overlayed "Graphic" control with transparent background on which I write the needed information via:
<snippet>
if(defined $$refGUIObj){
my $DC = $$refGUIObj->GetDC();
# Write text trasparently
$DC->BkMode($Transparent);
$DC->SelectObject(new Win32::GUI::Font(
-name => $Font,
-size => $FontSize,
-bold => 0,
)
);
$DC->BackColor(0);
$DC->TextColor($FgColor);
$DC->TextOut($X, $Y, $Text);
$DC->Validate();
}
</snippet>
Unfortunately every new instance overwrites the previous "TextOut". I have attempted to handle it inside the Paint event via:
<snippet>
my $clip_rgn = Win32::GUI::Region->CreateRectRgn( $l, $t, $r, $b );
$dc->SelectClipRgn($clip_rgn);
</snippet>
But only to obtain a yes redrawn window but with the "default" gray background.
Thank you in advance for any assistance you can offer,
Giuseppe
PS For multiple reasons I cannot write directly on the image, hence the need for a transparent "overlay" on which to handle all extra information.
|