Image::Base::Gtk2::Gdk::Image -- draw into a Gtk2::Gdk::Image
use Image::Base::Gtk2::Gdk::Image; my $image = Image::Base::Gtk2::Gdk::Image->new (-width => 100, -height => 100, -colormap => Gtk2::Gdk::Colormap->get_system); $image->line (0,0, 99,99, '#FF00FF'); $image->rectangle (10,10, 20,15, 'white');
Image::Base::Gtk2::Gdk::Image is a subclass of Image::Base,
Image::Base::Gtk2::Gdk::Image
Image::Base
Image::Base Image::Base::Gtk2::Gdk::Image
Image::Base::Gtk2::Gdk::Image extends Image::Base to create and draw into GdkImage objects. It requires Perl-Gtk2 1.240 for the full GdkImage support there. 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 GdkImage has a colormap then also anything recognised by Gtk2::Gdk::Color->parse, such as "pink" and hex #RRGGBB or #RRRRGGGGBBB. As of Gtk 2.20 the colour names are the Pango compiled-in copy of the X11 rgb.txt.
Gtk2::Gdk::Color->parse
A GdkImage is designed to copy pixel data between client memory and a window (or pixmap) on the server. Because it uses a Gtk2::Gdk::Visual it's restricted to the depths (bits per pixel) supported the server windows and so isn't a general purpose pixel array.
Gtk2::Gdk::Visual
See "FUNCTIONS" in Image::Base for the behaviour common to all Image-Base classes.
$image = Image::Base::Gtk2::Gdk::Image->new (key=>value,...)
Create and return a new image object. It can be pointed at an existing Gtk2::Gdk::Image,
Gtk2::Gdk::Image
$image = Image::Base::Gtk2::Gdk::Image->new (-gdkimage => $gdkimage);
Or a new Gtk2::Gdk::Image created,
$image = Image::Base::Gtk2::Gdk::Image->new (-width => 10, -height => 10);
Creating a GdkImage requires a size and visual, and optionally a colormap.
-width => integer -height => integer -visual => Gtk2::Gdk::Visual object -colormap => Gtk2::Gdk::Colormap object or undef
-visual defaults to the visual of the -colormap if given, or to the Gtk "system" visual otherwise.
-visual
-colormap
$image->xy ($x, $y, $colour)
Get or set the pixel at $x,$y.
$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.
-gdkimage
The target Gtk2::Gdk::Image object.
-width
-height
The size of a GdkImage cannot be changed once created.
Gtk2::Gdk::Colormap
-depth
The GdkImage get_depth, being the bits per pixel.
get_depth
Gtk2::Gdk::Image, Image::Base, Image::Base::Gtk2::Gdk::Drawable
http://user42.tuxfamily.org/image-base-gtk2/index.html
Copyright 2010, 2011, 2012 Kevin Ryde
Image-Base-Gtk2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Image-Base-Gtk2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Image-Base-Gtk2. If not, see http://www.gnu.org/licenses/.
To install Image::Base::Gtk2::Gdk::Image, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Image::Base::Gtk2::Gdk::Image
CPAN shell
perl -MCPAN -e shell install Image::Base::Gtk2::Gdk::Image
For more information on module installation, please visit the detailed CPAN module installation guide.