For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > October 2004 > How to get an image file and display it on the screen?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to get an image file and display it on the screen?
Allen Windhorn

2004-10-27, 8:56 pm

This may turn out not to be a Perl question; if so I apologise and
will be grateful for any hints on where to go.

I want to retrieve an image file
(e.g. http://132.206.154.224/fullsize.jpg), and display it in a
particular spot on the screen (Windows at the moment, Linux maybe
later) in its own window which is just large enough to fit it. I
don't want to invoke the browser or an imaging program to display it.
(Later I might want to do some image processing, and I'll want to
update it every 5-10 seconds).

I've looked in CPAN under Imaging and HTML, but didn't find anything
that looked suitable for displaying the image. Any suggestions?

Thanks in advance.

Regards,
Allen
--
Allen Windhorn (507) 345-2782 FAX (507) 345-2805
Kato Engineering (Though I do not speak for Kato)
P.O. Box 8447, N. Mankato, MN 56002
Allen.Windhorn@LSUSA.com
Sherm Pendley

2004-10-27, 8:56 pm

Allen Windhorn wrote:

> I want to retrieve an image file
> (e.g. http://132.206.154.224/fullsize.jpg)


Have a look at the LWP module on CPAN.

> , and display it in a
> particular spot on the screen (Windows at the moment, Linux maybe
> later) in its own window which is just large enough to fit it. I
> don't want to invoke the browser or an imaging program to display it.
> (Later I might want to do some image processing, and I'll want to
> update it every 5-10 seconds).


Have a look at the Tk module on CPAN. I *think* it's been ported to
Windows, but I wouldn't swear by it.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Eric Bohlman

2004-10-27, 8:56 pm

Sherm Pendley <spamtrap@dot-app.org> wrote in news:YOSdna1-HKFEgh3cRVn-
pg@adelphia.com:

> Allen Windhorn wrote:
>
>
> Have a look at the LWP module on CPAN.
>
>
> Have a look at the Tk module on CPAN. I *think* it's been ported to
> Windows, but I wouldn't swear by it.


It has. What Allen wants to do can definitely be done (quite easily) with
a combination of Tk (to display the image) and LWP (to fetch the image).
Note that the current version of Tk (which requires Perl 5.8.x) includes
both Tk::JPEG and Tk::PNG which used to be outside the "core" distribution.
If, though, you have a requirement for 5.6.x, older versions of Tk will
still work; you'll just have to install the two modules separately.
Matt Garrish

2004-10-27, 8:56 pm


"Allen Windhorn" <Allen.Windhorn@LSUSA.com> wrote in message
news:uvfcv95fz.fsf@LSUSA.com...
> This may turn out not to be a Perl question; if so I apologise and
> will be grateful for any hints on where to go.
>
> I want to retrieve an image file
> (e.g. http://132.206.154.224/fullsize.jpg), and display it in a
> particular spot on the screen (Windows at the moment, Linux maybe
> later) in its own window which is just large enough to fit it. I
> don't want to invoke the browser or an imaging program to display it.
> (Later I might want to do some image processing, and I'll want to
> update it every 5-10 seconds).
>


Sounds like you're looking for Win32::GUI or the Tk extensions. Both would
allow you to create a new window, position it anywhere on the screen and
display a picture in it. If you are going to port the program later,
however, you're better off using the Tk module.

Matt


Allen Windhorn

2004-10-28, 3:59 pm

Thanks to all for the helpful suggestions. I knew about TK -- just
didn't think of it in this context.

Regards,
Allen
--
Allen Windhorn (507) 345-2782 FAX (507) 345-2805
Kato Engineering (Though I do not speak for Kato)
P.O. Box 8447, N. Mankato, MN 56002
Allen.Windhorn@LSUSA.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com