From: Giuseppe J. C. <msj...@ho...> - 2008-12-12 17:10:21
|
Hi all, I put together a smaller example to better show my issue. <code> #!/C/Perl/bin/perl.exe use strict; use warnings; use Win32::GUI(); use Win32::GUI::DIBitmap; $|++; my $interval = 1000; my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp") or die "newFromFile"; my $main = Win32::GUI::Window->new( -name => 'Main', -width => 150, -height => 100, -onTimer => \&redraw_Timer, -onPaint => \&Main_Paint, -text => 'Transparent Label', ); $main->AddTimer( "redraw_Timer", $interval ); my $label = $main->AddLabel( -text => scalar(localtime), -addstyle => 11, # TRANSPARENT ); #------------------------------------------------------------------------------- $main->Show(); Win32::GUI::Dialog(); $main->Hide(); exit(0); #------------------------------------------------------------------------------- sub Main_Paint { printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) ); my $self = shift; my $dc = shift; my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ]; $dib->StretchToDC( $dc, 0, 0, $width, $height ); $dc->Validate(); return 1; } sub Main_Terminate { -1; } sub redraw_Timer { my $temp = localtime; $main->InvalidateRect(1); # Forces Redraw select( undef, undef, undef, 1 / 4 ); $label->Text($temp); } </code> If I remove the bitmap background (onPaint) and add a "-background => [0,255,0]," to the Main window I obtain the desired result. Unfortunately in my case I am dealing with a background obtained via DC cals. Again, thank you in advance for any help. Giuseppe |