Thread Binary mit Tk::Photo anzeigen. (13 answers)
Opened by zipster at 2006-06-19 17:19

zipster
 2006-06-19 17:19
#45666 #45666
User since
2004-09-06
458 Artikel
BenutzerIn
[default_avatar]
Hi,

ich habe ein Bild für meine MySQL Datenbank in ein Binary umgewandelt.
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
...
my $bild;
open(IMG, "$bild_auswahl");
binmode(IMG);
{
local $/ = undef;
$bild = $dbh->quote(<IMG>);
}
close(IMG);

# in datenbank einfügen
my $sth = $dbh->do("UPDATE kontakte SET bild = $bild WHERE id = $ref_hash_haupt->{'id'}")|| die $DBI::errstr;
...


Jetzt würde ich gern das Bild auch wieder im Interface anzeigen lassen.
Wie muss ich vorgehen?

Ich habe es so probiert. Hab aber eine Fehlermeldung bekommen
Code: (dl )
1
2
$potrait = $frame_kontakte_haupt->Photo(-data => $ref_hash_haupt->{bild});  
my $bild = $frame_kontakte_haupt->Label(-image => $potrait, -width => "90", -height => "120")->grid(-row=>'0', -column=>'8', -rowspan => '6', -sticky => 'w');


Quote
couldn't recognize image data at C:/Perl/site/lib/Tk/Image.pm line 21.


Gruss
Seri aka zipster

View full thread Binary mit Tk::Photo anzeigen.