Image::Base::X11::Protocol::Pixmap -- draw into an X11::Protocol pixmap
use Image::Base::X11::Protocol::Drawable; my $X = X11::Protocol->new; use Image::Base::X11::Protocol::Pixmap; my $image = Image::Base::X11::Protocol::Pixmap->new (-X => $X, -width => 200, -height => 100, -for_window => $win); $image->line (0,0, 99,99, '#FF00FF'); $image->rectangle (10,10, 20,15, 'white');
Image::Base::X11::Protocol::Pixmap is a subclass of
Image::Base Image::Base::X11::Protocol::Drawable Image::Base::X11::Protocol::Pixmap
Image::Base to create and draw into X pixmaps by sending drawing requests to an X server using
X11::Protocol. There's no file load or save, just drawing operations.
See "FUNCTIONS" in Image::Base::X11::Protocol::Drawable and "FUNCTIONS" in Image::Base for behaviour inherited from the superclasses.
$image = Image::Base::X11::Protocol::Pixmap->new (key=>value,...)
Create and return a new image object. An existing pixmap can be used, usually with a colormap for where to allocate colours.
$image = Image::Base::X11::Protocol::Pixmap->new (-X => $x11_protocol_obj, -pixmap => $pixmap_xid, -colormap => $colormap_xid);
Or a new pixmap can be created,
$image = Image::Base::X11::Protocol::Pixmap->new (-X => $x11_protocol_obj, -width => 100, -height => 100); # default screen and depth
A pixmap requires a size, screen and depth, plus a colormap if allocating colours instead of making a bitmap or similar. The default is the
choose_screenand the depth of the root window on that screen, or desired settings can be applied with
-screen => integer screen number -depth => integer bits per pixel -colormap => integer XID
-depthis given and it's not the screen's default depth then there's no default colormap (since the screen's default would be wrong). This happens when creating a bitmap,
$image = Image::Base::X11::Protocol::Pixmap->new (-width => 10, -height => 10, -depth => 1); # bitmap, no colormap
The following further helper options can create a pixmap for use with a particular window or another pixmap,
-for_drawable => integer XID -for_window => integer XID
-for_drawablemeans the depth and screen of that pixmap or window.
-for_windowlikewise and in addition the colormap fetched from it per
GetWindowAttributes. Getting this information is a server round-trip (except for a root window) so if you already know those things then passing them as
Image::Base::X11::Protocol::Drawable for the base drawable attributes inherited.
The target pixmap.
-pixmapaccess the same attribute.
The size of a pixmap cannot be changed once created.
The maximum size allowed by the protocol is 32767x32767, and minimum 1x1. When creating a pixmap currently the sizes are chopped by Perl's
packto a signed 16 bits, which means 32768 to 65535 results in an X protocol error (being negatives), but for instance 65546 wraps around to 10 and will seem to work.
Image-Base-X11-Protocol is Copyright 2010, 2011, 2012, 2013 Kevin Ryde
Image-Base-X11-Protocol 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-X11-Protocol 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-X11-Protocol. If not, see <http://www.gnu.org/licenses/>.