![]() |
Images |
PPresenter Manual Images Options:
|
An important part of the design of
Portable Presenter is the requirement for
screen-size independency; fonts and also images are scaled, dependent on
the actual screen-size.
There are two packages which handle images which you can use:
They way how images work do differ on which package you use: Tk::Photo images are related to a canvas (say viewport), while Image::Magick images are device independent. General Image Options
Related OptionsRelated options of show new():
ExamplesExample 1: Use in the Markup FormatterA way to include an image in a show:use PPresenter; my $show = PPresenter->new; $show->addSlide(-template => 'main' , -main => '<IMG SRC=image.gif>');Options to the IMG tag of the markup-formatter are
RESIZE (reflects -resize), ENLARGE (-enlarge),
BASE (-sizeBase), and some more for markup.
If the package Image::Magick is installed, then PPresenter will resize the image with ImageMagick. In that case, nearly all imaginable image formats can be used. If the package is not installed, the image is read via Tk::Photo, which supports only a small set of formats (see manual on Tk::Photo). Example 2: Same image twiceIf you use the same image for the second time in the same show, those specified options will be neglected: the first use is defining the image.use PPresenter; my $show = PPresenter->new; $show->addSlide(-main => '<IMG SRC=image.gif RESIZE>'); $show->addSlide(-main => '<IMG SRC=image.gif RESIZE=0>');In both cases, the resized version of the same image is shown! For the second use, I also could have written SRC=image , because
the basename of the file is an alias for an already defined image.
Example 3: Predefining imagesThe previous example has a hazard: if you run your presentation out of order: start with the second slide and then the first. In that case, the image is not resized.To avoid the hazard, but also to improve your possibilities to specify the images, you can define an image outside a slide: use PPresenter; my $show = PPresenter->new; $show->image(-file => 'image.gif', -resize => 0); $show->addSlide(-main => '<IMG SRC=image>'); $show->addSlide(-main => '<IMG SRC=image>');Calling the image() function, you can specify the options
described in this manual-page. You can refer to the image under its
filename, the basename of the filename, or other aliases (as with all
PPresenter-objects, you may specify an option
-aliases => [ 'alias', 'alias2', ... ] Example 4: Reading the images yourselfIt is possible to read the images yourself, in your Perl-program, and then offer it to PPresenter. The possibilities are different if you want to use Tk::Photo or Image::Magick; Tk::Photo images are related to a MainWindow (viewport), while Image::Magick images are not. Read their manual-pages for more details.If you have created you own Photo or Magick image, you can add this to PPresenter with: $object = ...; # create Tk::Photo or Image::Magick object $show->image($object, -name => 'image');You do not have to specify a name in case of Image::Magick (the output filename will be taken by default), but it is clearer this way. Portable Presenter is written and maintained by Mark Overmeer. Copyright (C) 2000-2002, Free Software Foundation FSF. |