On Sun, 17 Sep 2006 21:58:56 -0700
"Bradley K. Embree" <bke@xxxxxxxxx> wrote:
Hi,
> I have a scalar containing a bmp (generated by ChartDirector
> (http://www.advsofteng.com/cdperl.html)) that I would like to create a
> Wx::Bitmap from, which I will then draw on a panel.
>
> Wx::Bitmap does not seem to be able to do this directly, but I thought I
> could create a Wx::Bitmap from a Wx::Image.
Correct.
> open my $fh, '<', \$chart_bmp or die "cannot open: $!";
> $bmp = Wx::Bitmap->new(
> Wx::Image->new( $fh, wxBITMAP_TYPE_BMP, -1 )
> );
>
> Which gives me an error of 'DIB Header: Image width > 32767 pixels for
> file.'.
This should work, though. I will have a look at it.
Which wxPerl/wxWidgets versions and platform are you using?
> I've tested the contents of $chart_bmp by opening a filehandle and
> printing the contents to the file and it is a valid bitmap. So I am a
> bit lost as far as where to go next.
>
> Is it possible to create a stream from a scalar? I've looked at
> wxInputStream but the docs indicate that it is not implemented in wxPerl.
Perl strams should be transparently wrapped into wxInputStreams.
Regards
Mattia
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
|