So, I've tried your proposal:
open ICON, '<', \$icon_data or die $!; my $image = Wx::Image->new(); $image->LoadFile( \*ICON, wxBITMAP_TYPE_ANY ); $images_sm->Add( Wx::Bitmap->new($image, -1) );
The result were errors like this: "Can't load image from file 'Wx::Image=SCALAR(0x33094dc)': file does not exist. Couldn't add an image to the image list."

Are you sure that $image->LoadFile(...) can take an IO::Scalar object?
No, I am not. I just adapted this trick from videobox (sorry, there is no browsable CVS there, you need to look into the released .zip, in dir VBR/RES.pm, this app's resource lib), where it sais:
package VBR::RES; # WARNING This file was automatically created by mkres.pl # Any changes will be lost! use MIME::Base64; use FindBin; use Carp; my %res=(); # Toolbar button bitmaps must be 16x15 256 colors! sub GetResource { my($name)=@_; $resname=lc($name); $resname =~ s/\\/\//g; if (defined $res{$resname}) { return $res{$resname}; } else { open(FILE,"$FindBin::RealBin/$name") or die $!; binmode(FILE); my $data=join('',<FILE>); warn("Read ".length($data)." bytes from file: $FindBin::RealBi +n/$name\n"); return $data; } } sub OpenResource { my($name)=@_; use IO::Scalar; my $data = GetResource($name); return IO::Scalar->new( \$data ); } sub GetImage { my($name)=@_; use Wx qw( wxBITMAP_TYPE_BMP ); my $file = OpenResource($name); my $image = Wx::Image->new(); $image->LoadFile( $file, wxBITMAP_TYPE_BMP ); close($file); return $image; } sub GetBitmap { my($name)=@_; return Wx::Bitmap->new(GetImage($name)); } Wx::InitAllImageHandlers(); my $resname=''; while (<DATA>) { if (/^$/) { undef $resname; } elsif (/^@(.*)/) { $resname=lc($1); $resname =~ s/\\/\//g; } elsif ($resname) { $res{$resname}.=decode_base64($_); } } close(DATA); 1; __DATA__ @vbr/bitmaps/add.bmp Qk0mBQAAAAAAADYEAAAoAAAAEAAAAA8AAAABAAgAAAAAAPAAAAASCwAAEgsAAAAAAAAAAA +AAAAAA AAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwADA3MAA8MqmAAAgQAAAIGAAACCAAAAgoA +AAIMAA ACDgAABAAAAAQCAAAEBAAABAYAAAQIAAAECgAABAwAAAQOAAAGAAAABgIAAAYEAAAGBgAA +BggAAA YKAAAGDAAABg4AAAgAAAAIAgAACAQAAAgGAAAICAAACAoAAAgMAAAIDgAACgAAAAoCAAAK +BAAACg YAAAoIAAAKCgAACgwAAAoOAAAMAAAADAIAAAwEAAAMBgAADAgAAAwKAAAMDAAADA4AAA4A +AAAOAg AADgQAAA4GAAAOCAAADgoAAA4MAAAODgAEAAAABAACAAQABAAEAAYABAAIAAQACgAEAAwA +BAAOAA QCAAAEAgIABAIEAAQCBgAEAggABAIKAAQCDAAEAg4ABAQAAAQEAgAEBAQABAQGAAQECAAE +BAoABA QMAAQEDgAEBgAABAYCAAQGBAAEBgYABAYIAAQGCgAEBgwABAYOAAQIAAAECAIABAgEAAQI +BgAECA gABAgKAAQIDAAECA4ABAoAAAQKAgAECgQABAoGAAQKCAAECgoABAoMAAQKDgAEDAAABAwC +AAQMBA AEDAYABAwIAAQMCgAEDAwABAwOAAQOAAAEDgIABA4EAAQOBgAEDggABA4KAAQODAAEDg4A +CAAAAA gAAgAIAAQACAAGAAgACAAIAAoACAAMAAgADgAIAgAACAICAAgCBAAIAgYACAIIAAgCCgAI +AgwACA IOAAgEAAAIBAIACAQEAAgEBgAIBAgACAQKAAgEDAAIBA4ACAYAAAgGAgAIBgQACAYGAAgG +CAAIBg oACAYMAAgGDgAICAAACAgCAAgIBAAICAYACAgIAAgICgAICAwACAgOAAgKAAAICgIACAoE +AAgKBg AICggACAoKAAgKDAAICg4ACAwAAAgMAgAIDAQACAwGAAgMCAAIDAoACAwMAAgMDgAIDgAA +CA4CAA gOBAAIDgYACA4IAAgOCgAIDgwACA4OAAwAAAAMAAIADAAEAAwABgAMAAgADAAKAAwADAAM +AA4ADA IAAAwCAgAMAgQADAIGAAwCCAAMAgoADAIMAAwCDgAMBAAADAQCAAwEBAAMBAYADAQIAAwE +CgAMBA wADAQOAAwGAAAMBgIADAYEAAwGBgAMBggADAYKAAwGDAAMBg4ADAgAAAwIAgAMCAQADAgG +AAwICA AMCAoADAgMAAwIDgAMCgAADAoCAAwKBAAMCgYADAoIAAwKCgAMCgwADAoOAAwMAAAMDAIA +DAwEAA wMBgAMDAgADAwKAA8Pv/AKSgoACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AA +cHBwcH BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcAAAAAAAcHBwcHBwcHBwcAAPn5+Q +AABwcH BwcHBwcA+fn5+fn5+QAHBwcHBwcHAPn5+QD5+fkABwcHBwcHAPn5+fkA+fn5+QAHBwcHBw +D5+QAA AAAA+fkABwcHBwcA+fn5+QD5+fn5AAcHBwcHBwD5+fkA+fn5AAcHBwcHBwcA+fn5+fn5+Q +AHBwcH BwcHBwAA+fn5AAAHBwcHBwcHBwcHBwAAAAcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBw +cHBwcH BwcHBwcHBw== (snip)

Is there some magic in VBR/RES.pm's routine nesting? And: the maturity of the videobox app tells me there must be some nasty bug in my routine... Anyone objecting?

In reply to Re^2: What's wrong with this Wx::Bitmap construction? by isync
in thread What's wrong with this Wx::Bitmap construction? by isync

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.