in reply to Resizing images && Tk

I don't have Tk or GD available to me at the moment, so I'm just theorizing, but...

Could you make the image a GD object and then use that as the -data for your Tk::Photo? Then you could maybe use GD to manipulate the image (GD::Image::copyResized).

I know it's not exactly what you were looking for, but I don't see any way to scale a Tk::Photo in non-integer steps. The resizing looks to be all single pixel based in the Tk backend as opposed to lengths. You can't, e.g., take the 4.5th pixel or make something 80.493 pixels long. I don't see any non-integer manipulation functions in tkImgPhoto.h

Replies are listed 'Best First'.
Re: Re: Resizing images && Tk
by Jouke (Curate) on Mar 14, 2001 at 15:03 UTC
    Your answer sounded so logical, I immediately tried it out. But it turns out that GD returns its data as real raw data, like it should be stored in a file, and that Tk::Photo takes data the way it produces it with the data() method, that is an ASCII string. Very strange, and I have no clue why anyone would want such a string...

    So if anyone knows how to convert between these different formats, please let me know.

    Jouke Visser, Perl 'Adept'