I just committed 2 new functions for handling windows regions:
New region method:
my $data = $rgn->GetRgnData();
wraps the win32 API GetRegionData() function
New region constructor:
my $newrgn = Win32::GUI::Region->ExtCreateRgn($data);
wraps the win32 API ExtCreateRegion() function
Tracker 1469648:
https://sourceforge.net/tracker/index.php?func=detail&aid=1469648&group_id=16572&atid=366572
As a quick test I did the following:
#!perl -w
use strict;
use warnings;
use Win32::GUI();
my $mw = Win32::GUI::Window->new(
-title => "Region test",
-size => [400,300],
);
$mw->Show();
my $DC = $mw->GetDC();
my $rgn = Win32::GUI::Region->CreateRoundRectRgn(0,0,100,100,50,50);
$DC->InvertRgn($rgn);
my $rgndata = $rgn->GetRgnData();
my $newrgn = Win32::GUI::Region->ExtCreateRgn($rgndata);
$newrgn->OffsetRgn(150,150);
$DC->InvertRgn($newrgn);
Win32::GUI::Dialog();
$mw->Hide();
exit(0);
__END__
Regards,
Rob.
--
Robert May
Win32::GUI, a perl extension for native Win32 applications
http://perl-win32-gui.sourceforge.net/
|