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 need
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
error
2) this doesn't work: $win-> lblLogo(-bitmap => $logo); - no error
generated

Could some kind soul help me understand where I'm going wrong please?


Thanks
Brian Rowlands
We must accept finite disappointment, but we must never lose infinite
hope.
Martin Luther King Jr. </quotes/k/martinlutherking/>  



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to