|
From: King P. <ki...@gm...> - 2011-01-14 11:44:57
|
Hello Maillist,
maybe you could help me.
When I rescale an Image the old image is still seen and not removed. How to
do that?
When resizing the main window all is rewritten and looks fine. If I rescale
the image via a button I have the strange effect.
Hopefully you understood my issue and can help me?!
Many Thanks
Here my example:
#perl -w
use Win32::GUI;
use Win32::GUI::DIBitmap;
$W = new Win32::GUI::Window (
-title => "Win32::GUI::DIBitmap test",
-left => 100,
-top => 100,
-width => 600,
-height => 400,
-name => "Window",
) or die "new Window";
$W->AddButton(-name=>
"MINSIZE",-text=>"PIC",-left=>1,-top=>250,-width=>30,-height=>30,-visible=>1
,);
my $dib = newFromFile Win32::GUI::DIBitmap ('temp/temp.tif');
my $x; my $y;
$W->Show();
Win32::GUI::Dialog();
sub MINSIZE_Click { $x+=10; $y+=10; Paint(); }
sub Window_Resize { Paint(); }
sub Window_Activate { Paint(); }
sub Window_Terminate { $W->PostQuitMessage(0); }
sub Paint {
Win32::GUI::DC::ReleaseDC($W, $dc);
$dc = new Win32::GUI::DC ($W);
$dispdib = $dib -> Rescale(200-$x, 200-$y);
$dispdib->CopyToDC($dc);
}
|