NAME

App::MathImage::Image::Base::Gtk::Gdk::Pixmap -- draw into a Gdk pixmap

SYNOPSIS

use App::MathImage::Image::Base::Gtk::Gdk::Pixmap;
my $image = App::MathImage::Image::Base::Gtk::Gdk::Pixmap->new
                (-width => 10,
                 -height => 10,
                 -for_drawable => $win);
$image->line (0,0, 99,99, '#FF00FF');
$image->rectangle (10,10, 20,15, 'white');

CLASS HIERARCHY

App::MathImage::Image::Base::Gtk::Gdk::Pixmap is a subclass of Image::Base::Gtk::Gdk::Drawable,

Image::Base
  Image::Base::Gtk::Gdk::Drawable
    App::MathImage::Image::Base::Gtk::Gdk::Pixmap

DESCRIPTION

App::MathImage::Image::Base::Gtk::Gdk::Pixmap extends Image::Base to create and draw into Gdk Pixmaps. There's no file load or save, just drawing operations.

The drawing is done by the Image::Base::Gtk::Gdk::Drawable base class. This class adds some pixmap creation help.

FUNCTIONS

See "FUNCTIONS" in Image::Base::Gtk::Gdk::Drawable and "FUNCTIONS" in Image::Base for the behaviour inherited from the superclasses.

$image = App::MathImage::Image::Base::Gtk::Gdk::Pixmap->new (key=>value,...)

Create and return a new pixmap image object. It can be pointed at an existing pixmap,

$image = App::MathImage::Image::Base::Gtk::Gdk::Pixmap->new
             (-pixmap => $pixmap);

Or a new pixmap created,

$image = App::MathImage::Image::Base::Gtk::Gdk::Pixmap->new
             (-width    => 10,
              -height   => 10);

A pixmap requires a size and, depth (bits per pixel) and usually a colormap for allocating colours. The default is the screen depth and colormap, or desired settings can be applied with

-depth    =>  integer bits per pixel
-colormap =>  Gtk::Gdk::Colormap object or undef

If just -colormap is given then the depth is taken from it. If -depth is given and it's not the screen's default depth then there's no default colormap (as it would be wrong), which happens when creating a bitmap,

$image = App::MathImage::Image::Base::Gtk::Gdk::Pixmap->new
             (-width   => 10,
              -height  => 10,
              -depth   => 1);  # bitmap, no colormap

The following further helper options can create a pixmap for use with a widget, window, or another pixmap,

-for_drawable  => Gtk::Gdk::Drawable object (win or pixmap)
-for_widget    => Gtk::Widget object

These targets give a colormap and depth. -colormap and/or -depth can be given to override if desired.

If a widget plays tricks with its window colormap or depth then it might only have the right settings after realized (ie. has created its window).

$new_image = $image->new (key=>value,...)

Create and return a copy of $image. The underlying pixmap is cloned by creating a new one and copying contents to it.

ATTRIBUTES

-width (integer, read-only)
-height (integer, read-only)

The size of a pixmap cannot be changed once created.

-pixmap (Gtk::Gdk::Pixmap object)

The target pixmap. -drawable and -pixmap access the same attribute.

SEE ALSO

Image::Base, Image::Base::Gtk::Gdk::Drawable, Image::Base::Gtk::Gdk::Window, Gtk::reference