Thread Tk::Photo und -data (5 answers)
Opened by Gast at 2007-07-30 01:17

Gast Gast
 2007-07-30 01:17
#96739 #96739
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
sub main_gui {
$mw = shift;
my $frame_left = $mw->Frame(-background => 'red', -width => 130, -height => 500);
my $frame_right = $mw->Frame(-background => 'blue', -width => 170, -height => 500);
my $frame_center = $mw->Frame(-background => 'yellow', -width => 500, -height => 400);
my $frame_bottom = $mw->Frame(-background => 'green', -width => 500, -height => 100);

$frame_left ->grid(-row => 0, -column => 0, -rowspan => 2);
$frame_right ->grid(-row => 0, -column => 2, -rowspan => 2);
$frame_center->grid(-row => 0, -column => 1);
$frame_bottom->grid(-row => 1, -column => 1);


my $image_data = newFromJpeg GD::Image('DSCF0334.JPG')|| die $!;
print $image_data = decode_base64($image_data->jpeg(100) );

my $image = $frame_center->Photo(-data => $image_data );
my $small_foto = $mw->Photo;
$small_foto->copy($image, -subsample => 5,5);
$image->blank();
$frame_center->Label( -image => $small_foto )->pack();
}


MfG

View full thread Tk::Photo und -data