in reply to Re: Resizing Jpegs in TK
in thread Resizing Jpegs in TK

Zaxo, Thanx for replying, I attempted to use -subample, but I can only seem to get it to work when using method (copy). It still appears to try and put a full size image together and then copy a portion of it. This still creates an odd mish-mash looking picture (although it is smaller). I tried using various values for subsample. (1) (2) (2,2) (3,3) (4,4) (3) (4) none of them appear to work properly. Am I doing something wrong?
#!/usr/bin/perl -w use Tk; use Tk::Photo; use Tk::JPEG; use strict; my $file="c:/pictures/2005/guns/DSC00101.JPG"; my $w=new MainWindow; my $image1=$w->Photo(-file=>"$file", -format => 'jpeg'); my $image=$w->Photo(); $image->copy($image1,-subsample=>4); $b = $w->Button( -image => $image )->pack(); $b->configure(-image => $image); &MainLoop;


-Kevin

Replies are listed 'Best First'.
Re^3: Resizing Jpegs in TK
by zentara (Cardinal) on Jan 17, 2005 at 12:50 UTC
    This code of yours works fine on Linux.

    I'm not really a human, but I play one on earth. flash japh
Re^3: Resizing Jpegs in TK
by BrowserUk (Patriarch) on Jan 17, 2005 at 13:02 UTC

    Works fine on XP/5.85 too.


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
      Turns out, that was part of my problem. I was using version 5.8.3 and it was giving me all sorts of problems. I upgraded to 5.8.6 and it generates properly now. Thanx!