Image::Base::Prima::Image -- draw into Prima image
use Image::Base::Prima::Image; my $image = Image::Base::Prima::Image->new (-width => 200, -height => 100); $image->line (0,0, 99,99, '#FF00FF'); $image->rectangle (10,10, 20,15, 'white');
Image::Base::Prima::Image is a subclass of Image::Base::Prima::Drawable,
Image::Base::Prima::Image
Image::Base::Prima::Drawable
Image::Base Image::Base::Prima::Drawable Image::Base::Prima::Image
Image::Base::Prima::Image extends Image::Base to create and draw into Prima::Image objects, including file loading and saving.
Image::Base
Prima::Image
See Image::Base::Prima::Drawable for the drawing operations. This subclass adds image creation and file load/save. begin_paint() / end_paint() bracketing is still necessary.
begin_paint()
end_paint()
As of Prima 1.28 the supported file formats for both read and write include PNG, JPEG, TIFF, GIF, XBM, XPM and BMP. Prima on X11 draws using the X server, so an X connection is necessary. Don't use Prima::noX11 or drawing operations will quietly do nothing.
Prima::noX11
See "FUNCTIONS" in Image::Base::Prima::Drawable and "FUNCTIONS" in Image::Base for behaviour inherited from the superclasses.
$image = Image::Base::Prima::Image->new (key=>value,...)
Create and return a new image object. A new Prima::Image object can be created, usually with a -width and -height (but it also works to set them later),
-width
-height
$ibase = Image::Base::Prima::Image->new (-width => 200, -height => 100);;
Or an existing Prima::Image object can be given
$ibase = Image::Base::Prima::Image->new (-drawable => $prima_image);
$image->load ()
$image->load ($filename)
Load from -file, or with a $filename argument set -file then load.
-file
$filename
The Prima loadExtras option is used so as to get the file format codecID in the underlying image, and any possible "hotspot" for -hotx and -hoty below ("ATTRIBUTES").
loadExtras
codecID
-hotx
-hoty
$image->save ()
$image->save ($filename)
Save to -file, or with a $filename argument set -file then save to that.
As per Prima save, the file format is taken from the underlying $primaimage->{'extras'}->{'codecID'} if that's set, otherwise from the filename extension. The -file_format attribute below can set the desired output format.
save
$primaimage->{'extras'}->{'codecID'}
-file_format
For saving Prima takes the file format from the filename extension, for example ".png". See Prima::image-load.
undef
The file format as a string like "PNG" or "JPEG", or undef if unknown or never set. Getting or setting -file_format operates on the $primaimage->{'extras'}->{'codecID'} field of the underlying Prime::Image.
Prime::Image
After load the -file_format is the format read. Setting -file_format changes the format for a subsequent save.
load
The cursor hotspot in images with that attribute. These are the hotSpotX and hotSpotY extra in the $primaimage->{'extras'} (see Prima::codecs and "Querying extra information" in Prima::image-load). As of Prima 1.29 they're available from XPM and XBM format files.
hotSpotX
hotSpotY
$primaimage->{'extras'}
-quality_percent
The image quality when saving to JPEG format. JPEG compresses by reducing colours and resolution in ways that are not too noticeable to the human eye. 100 means full quality, no such reductions. undef means the Prima default, which is 75.
This becomes the quality parameter to $primaimage->save().
quality
$primaimage->save()
Image::Base, Prima::Image, Prima::image-load, Image::Base::Prima::Drawable
Image::Xpm, Image::Xbm, Image::Base::GD, Image::Base::PNGwriter, Image::Base::Gtk2::Gdk::Pixbuf
http://user42.tuxfamily.org/image-base-prima/index.html
Image-Base-Prima is Copyright 2010, 2011, 2015 Kevin Ryde
Image-Base-Prima 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-Prima 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-Prima. If not, see <http://www.gnu.org/licenses/>.
To install Image::Base::Prima::Image, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Image::Base::Prima::Image
CPAN shell
perl -MCPAN -e shell install Image::Base::Prima::Image
For more information on module installation, please visit the detailed CPAN module installation guide.