4 use Wx qw(wxBITMAP_TYPE_ICO);
6 use Test::More 'tests' => 6;
9 my $app = Wx::SimpleApp->new;
10 Wx::InitAllImageHandlers;
14 open my $fh, '< :raw', $_[0];
18 # plain Perl handle (file)
20 open my $fh, '< :raw', 'wxpl.ico';
21 my $img = Wx::Image->new( $fh, wxBITMAP_TYPE_ICO );
23 is( $img->GetWidth, 32 );
26 # in-memory file (uses PerlIO, hasn't a filehandle
28 skip 'Perl 5.8 required', 2 if $] < 5.008;
30 my $data = _slurp( 'wxpl.ico' );
31 open my $fh, '<', \$data;
32 my $img = Wx::Image->new( $fh, wxBITMAP_TYPE_ICO );
34 is( $img->GetWidth, 32 );
39 eval { require IO::String };
40 skip 'IO::String required', 2 if $@;
42 my $data = _slurp( 'wxpl.ico' );
43 my $fh = IO::String->new( $data );
44 my $img = Wx::Image->new( $fh, wxBITMAP_TYPE_ICO );
46 is( $img->GetWidth, 32 );