From: Brian R. (G. H. School) <Row...@gr...> - 2007-10-14 09:04:14
|
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:=20 my @array; my $dbh =3D DBI-> connect("dbi:SQLite:dbname=3D$datafile","","",{}); = # database handle my $sql =3D "SELECT icon FROM icons WHERE name =3D 'logo'"; my $sth =3D $dbh-> prepare($sql); # statement handle if (defined($sth)) { $sth -> execute(); while (my @result =3D $sth-> fetchrow_array()) { push (@array, $result[0]); } } $sth->finish; undef $sth; $dbh->disconnect();=20 # check I've got an icon my $size =3D @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=01%0=18%0%0%0%0%0Hr%0%0%0% = ... # which makes me think all is ok so far=20 # create an "inline" bitmap file my $logo =3D 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 =3D> $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/> =20 |