NAME
App::MathImage::Image::Base::Gtk::Gdk::Image -- draw into a Gtk::Gdk::Image
SYNOPSIS
use App::MathImage::Image::Base::Gtk::Gdk::Image;
my $image = App::MathImage::Image::Base::Gtk::Gdk::Image->new
(-width => 100,
-height => 100,
-colormap => Gtk::Gdk::Colormap->get_system);
$image->line (0,0, 99,99, '#FF00FF');
$image->rectangle (10,10, 20,15, 'white');
CLASS HIERARCHY
App::MathImage::Image::Base::Gtk::Gdk::Image
is a subclass of Image::Base
,
Image::Base
App::MathImage::Image::Base::Gtk::Gdk::Image
DESCRIPTION
In progress ...
App::MathImage::Image::Base::Gtk::Gdk::Image
extends Image::Base
to create and draw into GdkImage objects. A GdkImage is pixel data in client-side memory. There's no file load or save, just drawing operations.
Colour names are raw integer pixel values, and special names "set" and "clear" for pixel values 1 and 0 to use with bitmaps. If the -colormap
attribute is set then also anything recognised by Gtk::Gdk::Color->parse_color()
, such as "pink" and hex #RRGGBB or #RRRRGGGGBBB.
A GdkImage is designed to copy pixel data between client memory and a window (or pixmap) on the server. Because it uses a Gtk::Gdk::Visual
it's restricted to the depths (bits per pixel) supported the server windows and so isn't a general purpose pixel array.
FUNCTIONS
See "FUNCTIONS" in Image::Base for the behaviour common to all Image-Base classes.
$image = App::MathImage::Image::Base::Gtk::Gdk::Image->new (key=>value,...)
-
Create and return a new image object. It can be pointed at an existing
Gtk::Gdk::Image
,$image = App::MathImage::Image::Base::Gtk::Gdk::Image->new (-gdkimage => $gdkimage);
Or a new
Gtk::Gdk::Image
created,$image = App::MathImage::Image::Base::Gtk::Gdk::Image->new (-width => 10, -height => 10);
Creating a GdkImage requires a size and visual, and optionally a colormap.
-width => integer -height => integer -visual => Gtk::Gdk::Visual object -colormap => Gtk::Gdk::Colormap object or undef
-visual
defaults to the visual of the-colormap
if given, or to the Gtk "system" visual otherwise. $image->xy ($x, $y, $colour)
-
Get or set the pixel at
$x
,$y
.Currently if the GdkImage has a colormap then colours are returned in #RRRRGGGGBBBB form. Without a colormap the return is the integer pixel value integer.
ATTRIBUTES
-gdkimage
(Gtk::Gdk::Image
object)-
The target
Gtk::Gdk::Image
object. -width
(integer, read and create only)-height
(integer, read and create only)-
The size of a GdkImage cannot be changed once created.
-visual
(Gtk::Gdk::Visual
, read or create only)-colormap
(Gtk::Gdk::Colormap
, read/write)-depth
(integer, read-only)-
The GdkImage
get_depth
, being the bits per pixel.
SEE ALSO
Gtk::Gdk::Image, Image::Base, Image::Base::Gtk::Gdk::Drawable