Tk::Photo images

PPresenter
Manual
Images

Options:

functions
Examples

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.

You can defined Tk::Photo images in two ways:

  • Implicit: use an image in your slide description, for instance with
      $show->addSlide(-main => '<IMG SRC=image.xpm>');
    
    In this case, you have created a Tk::Photo object, but are not able to control it, although there are some options which you can use when you use the markup formatter.

  • Explicit: define an image and refer to it later. For this, you have to know that Tk::Photo objects are related to a MainWindow. A PPresenter show can contain different viewports, so you have to tell beforehand to which of them the image will be used.
The explicit way is demonstrated on this page. The implicit way is the same for Tk::Photo objects and Image::Magick object, which is described on the main image page.

tkPhoto options

There are no special options for tkPhoto objects: the general options define all.

tkPhoto functions

Each Tk::Photo object is related to a MainWindow, to one viewport. To create one, you need to reach the window, so require the help of PPresenter:
   $show->image($show->Photo(..options..));

   my $vp = $show->find(viewport => 'default');
   $show->image($vp->Photo(..options..));

   my $vp = $show->addViewport(...);
   my $p  = $vp->Photo(...);
   $show->image($p);
The problem now, is that the image is defined for only one viewport: the `selected viewport' of the show, in the first case (i.e. thè window if you have only one); the viewport named `default' in the second case; and the explicitly added viewport in the last case.

If you want to use an image for more than one viewport, you do not have to take care yourself: PPresenter makes a copy for each viewport where it is used in.

One PPresenter::Image object is created on the image() fuction call, so you can specify the options for that object there. For objects created this way, the default of -resize is off (0).

Examples

Example 1: Own symbols for unordered lists

Usually, the dots used to precede a list-item in an unordered list (for instance used by the markup formatter), is defined by the decoration option -nestImages. The dots can be specified as filename or as objects.

   use PPresenter;

   my @p;
   $p[0] = $show->Photo(-file => 'redball.gif');
   $p[1] = $show->Photo(-file => 'blueball.pct');

   $show->change( decoration  => 'ALL'
                , -nestImages => [ undef, @p ] )


Portable Presenter is written and maintained by Mark Overmeer. Copyright (C) 2000-2002, Free Software Foundation FSF.