DocJon has asked for the wisdom of the Perl Monks concerning the following question:
In the wxWidgets documentation, reference is made to using the wxBitmap constructor in place of ConvertToBitmap, but it isn't clear that wxPerl has implemented that constructor. The following code shows a simplified version of what I am trying to do:
So my question is what to put in place of the ??? to get a bitmap, which can be used in StaticBitmap, from the scaled image.use Wx; package MyApp; use strict; use vars qw(@ISA); @ISA = qw(Wx::App); sub OnInit { my( $this ) = @_; my( $frame ) = MyFrame->new( undef, -1, "Image Resize", [100, 100], [450, 300] ); $frame->Show( 1 ); return 1; } package MyFrame; use strict; use vars qw(@ISA); use Wx qw(wxBITMAP_TYPE_BMP); @ISA = qw(Wx::Frame); sub new { my $class = shift; my $this = $class->SUPER::new(@_); my $image = Wx::Image->new('print.bmp',wxBITMAP_TYPE_BMP)->Scale(3 +2,32); # my $bmp = $image->ConvertToBitmap(); old way, no longer supporte +d my $bmp = ???; $this->{ImageViewer}= Wx::StaticBitmap->new($this, -1, $bmp); $this; } package main; my $app = MyApp->new(); $app->MainLoop();
Thanks,
Jon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: scaling wxPerl bitmaps
by PodMaster (Abbot) on Dec 14, 2005 at 08:22 UTC |