From: Armin Roehrl Date: 2001-08-20T10:43:50+09:00 Subject: [ruby-talk:20003] Re: OT: Need tcl code to read jpg image I'm far off from knowing anything about tk, but does TkPhotoImage coming with Ruby support jpgs by now? Not on the version I got installed. (note: it should not be too difficult to port.) TkPhotoImage.new { file "myimage.jpg" } fails so to speak. In Perl you might use Tk::JPEG -- #!/usr/bin/perl -w use strict; use Tk; require Tk::JPEG; my $main = new MainWindow; my $jpgimg = $main -> Photo('-format' => 'jpeg'. -file => "testimg.jpg"); my $c = $main->Label('-image' => $jpgimg)->pack; MainLoop; --- Be lazy & why don't you call an external program like display or xv to display the jpeg image from your ruby prg,? (or convert the images into gifs?) tcl, haven't used it for a long time, but last time I looked you need to patch wish and then you could do sth. like --- c.f. http://www.xmission.com/~georgeps/multimedia.html load libimg.so canvas .can pack .can set picture [image create photo -file test.jpg] .can create image 0 0 -image $picture ---- good luck. Armin On Monday 20 August 2001 02:29, you wrote: > Hi: > > I don't know tk but I know Ruby and I have a simple gui based > routine that I need to implement, possibly with ruby/tk. > I need a tk program that will display a jpg image. I've looked > around, but have not found a quick solution. Can some tk expert help me > out. > > The application is simple and I would not be surprised if one already > exists. I need it to display an image and then respond to a key press to > execute a system command (i.e. rotate the image). > > Thanks for the help and sorry about the OT. > > ========================================================= > Jim Freeze > jim@freeze.org > --------------------------------------------------------- > No comment at this time. > http://www.freeze.org > ========================================================= -- Armin. ----------------------------------------------- Armin Roehrl, http://www.approximity.com "The best way to predict the future is to invent it." --Alan Kay