http://www.perlmonks.org?node_id=288735


in reply to Re: wxPerl image handling (short & sweet).
in thread wxPerl image handling (short & sweet).

Yes, you installed a modern version of Wx {grin}

If you examine http://search.cpan.org/author/MBARBON/Wx-0.08/ released about the same time as this tutorial, you can see a Wx::Image listed (also in http://search.cpan.org/src/MBARBON/Wx-0.08/lib/Wx/).

If you examine http://search.cpan.org/src/MBARBON/Wx-0.16/lib/Wx/ you can see there is no Image.pm, but http://search.cpan.org/src/MBARBON/Wx-0.16/XS/Image.xs (like http://search.cpan.org/src/MBARBON/Wx-0.08/XS/Image.xs) still exists.

This means that you only need to say "use Wx;" and the Wx::Image package will be loaded.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re: Re: wxPerl image handling (short & sweet).

Replies are listed 'Best First'.
Re: Re: Re: wxPerl image handling (short & sweet).
by Anonymous Monk on Sep 04, 2003 at 21:35 UTC
    Thanks - that fixed it.

    I also had to change the ConvertToBitmap method call (listed as deprecated in the doco, and not found at runtime) to a Wx::Bitmap->new call.

    So now it runs, but photos look just awful. It looks like there isn't enough colour depth, but $bmp->getDepth() returns 24.

      It seems the problem is displaying images below their native resolution. I think there's something wrong with the way the bitmap merges pixels.
      Kind of old thread but anyway. When I do my $bmp = Wx::Bitmap->new(); insted of CovertToBitmap i get overload error. Can you help me?