Hi I'm wanting to take an icon out of a SQLite database and paste it on a label in a Win32 GUI I've built using The GUI Loft. Sample code:
# suck icon from SQLite database: my @array; my $dbh = DBI-> connect("dbi:SQLite:dbname=$datafile","","",{}); # +database handle my $sql = "SELECT icon FROM icons WHERE name = 'logo'"; my $sth = $dbh-> prepare($sql); # +statement handle if (defined($sth)) { $sth -> execute(); while (my @result = $sth-> fetchrow_array()) { push (@array, $result[0]); } } $sth->finish; undef $sth; $dbh->disconnect(); # check I've got an icon my $size = @array; print "$size\n"; # prints 1 so ONE icon has been captured # printed $array[0] to a richedit window and got: # BM~r%0%0%0%0%0%06%0%0%0(%0%0%0\%0%0%0j%0%0%0%0%0%0 +%0%0%0Hr%0%0%0% ... # which makes me think all is ok so far # create an "inline" bitmap file my $logo = new Win32::GUI::BitmapInline($array[0]); # not sure if I ne +ed to do this or not # place bitmap on a label in a WinGui I've created with "The GUI Loft" + 1) this doesn't work: $win-> lblLogo-> SetImage($logo); - generates er +ror 2) this doesn't work: $win-> lblLogo(-bitmap => $logo); - no error gen +erated
Could some kind soul help me understand where I'm going wrong please?

In reply to Put a bitmap on a label by briannz556

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.