.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Gtk2::Gdk::Pixbuf 3pm" .TH Gtk2::Gdk::Pixbuf 3pm "2019-09-16" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Gtk2::Gdk::Pixbuf \- wrapper for GdkPixbuf .SH "HIERARCHY" .IX Header "HIERARCHY" .Vb 2 \& Glib::Object \& +\-\-\-\-Gtk2::Gdk::Pixbuf .Ve .SH "INTERFACES" .IX Header "INTERFACES" .Vb 2 \& Glib::Object::_Unregistered::GIcon \& Glib::Object::_Unregistered::GLoadableIcon .Ve .SH "METHODS" .IX Header "METHODS" .ie n .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew\fP ($colorspace, $has_alpha, $bits_per_sample, $width, $height)" .el .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew\fP ($colorspace, \f(CW$has_alpha\fP, \f(CW$bits_per_sample\fP, \f(CW$width\fP, \f(CW$height\fP)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->new ($colorspace, $has_alpha, $bits_per_sample, $width, $height)" .IP "\(bu" 4 \&\f(CW$colorspace\fR (Gtk2::Gdk::Colorspace) .IP "\(bu" 4 \&\f(CW$has_alpha\fR (boolean) .IP "\(bu" 4 \&\f(CW$bits_per_sample\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .ie n .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_data\fP ($data, $colorspace, $has_alpha, $bits_per_sample, $width, $height, $rowstride)" .el .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_data\fP ($data, \f(CW$colorspace\fP, \f(CW$has_alpha\fP, \f(CW$bits_per_sample\fP, \f(CW$width\fP, \f(CW$height\fP, \f(CW$rowstride\fP)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->new_from_data ($data, $colorspace, $has_alpha, $bits_per_sample, $width, $height, $rowstride)" .IP "\(bu" 4 \&\f(CW$data\fR (scalar) packed binary pixel data, usually made with \fBpack()\fR .IP "\(bu" 4 \&\f(CW$colorspace\fR (Gtk2::Gdk::Colorspace) .IP "\(bu" 4 \&\f(CW$has_alpha\fR (boolean) true if the image data includes an alpha channel (opacity information). .IP "\(bu" 4 \&\f(CW$bits_per_sample\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) in pixels. .IP "\(bu" 4 \&\f(CW$height\fR (integer) in pixels. .IP "\(bu" 4 \&\f(CW$rowstride\fR (integer) distance in bytes between row starts; usually 3*width for rgb data, 4*width if \fI\f(CI$has_alpha\fI\fR is true. .PP Creates a new Gtk2::Gdk::Pixbuf out of in-memory image data. Currently only \&\s-1RGB\s0 images with 8 bits per sample are supported. .PP In C this function allows you to wrap a GdkPixbuf structure around existing pixel data. In Perl, we have to use \f(CW\*(C`pack\*(C'\fR to generate a scalar containing the pixel data, and pass that scalar to \f(CW\*(C`new_from_data\*(C'\fR, which copies the scalar to keep it around. It also manages the memory automagically, so there's no need for a destruction notifier function. This all means that if you change your copy of the data scalar later, the pixbuf will \fInot\fR reflect that, but because of the way perl manages string data and scalars, it would be pretty fragile to do that in the first place. If you need to modify a pixbuf's data after it has been created, you can create new pixbufs for the changed regions and use \f(CW\*(C`$pixbuf\->composite\*(C'\fR, or try a different approach (possibly use a server-side pixmap and gdk drawing primitives, or something like libart). .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_file\fP ($filename)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->new_from_file ($filename)" .IP "\(bu" 4 \&\f(CW$filename\fR (localized file name) .PP May croak with a Glib::Error in $@ on failure. .ie n .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_file_at_scale\fP ($filename, $width, $height, $preserve_aspect_ratio)" .el .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_file_at_scale\fP ($filename, \f(CW$width\fP, \f(CW$height\fP, \f(CW$preserve_aspect_ratio\fP)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->new_from_file_at_scale ($filename, $width, $height, $preserve_aspect_ratio)" .IP "\(bu" 4 \&\f(CW$filename\fR (localized file name) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .IP "\(bu" 4 \&\f(CW$preserve_aspect_ratio\fR (boolean) .PP May croak with a Glib::Error in $@ on failure. .PP Since: gtk+ 2.6 .ie n .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_file_at_size\fP ($filename, $width, $height)" .el .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_file_at_size\fP ($filename, \f(CW$width\fP, \f(CW$height\fP)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->new_from_file_at_size ($filename, $width, $height)" .IP "\(bu" 4 \&\f(CW$filename\fR (localized file name) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .PP May croak with a Glib::Error in $@ on failure. .PP Since: gtk+ 2.4 .ie n .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_inline\fP ($data, $copy_pixels=TRUE)" .el .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_inline\fP ($data, \f(CW$copy_pixels\fP=TRUE)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->new_from_inline ($data, $copy_pixels=TRUE)" .IP "\(bu" 4 \&\f(CW$data\fR (scalar) packed binary data, the format is special, see discussion .IP "\(bu" 4 \&\f(CW$copy_pixels\fR (boolean) whether \fI\f(CI$data\fI\fR should be copied, defaults to true .PP Gtk+ ships with a tool called \f(CW\*(C`gdk\-pixbuf\-csource\*(C'\fR, which turns any image understood by gdk-pixbuf into the C syntax of the declaration of a static data structure containing that image data, to be #included directly into your source code. \f(CW\*(C`gdk_pixbuf_new_from_inline\*(C'\fR creates a new GdkPixbuf from that data structure. .PP Currently, this is not very easy to do from Perl. The output of \&\f(CW\*(C`gdk\-pixbuf\-csource\*(C'\fR must be mangled rather ruthlessly to create valid Perl code using pack and translation from C string escapes to valid Perl string escapes (for encoding and interpretation isses). Because Perl scalars are garbage collected, it's rather rare to have the ability to use static data, so \fI\f(CI$copy_pixels\fI\fR defaults to true; if you can guarantee the image data will outlive the pixbuf you can pass false here and save some memory. .PP For more information, see the description of \f(CW\*(C`gdk_pixbuf_new_from_inline\*(C'\fR in the C \s-1API\s0 reference at http://gtk.org/api/ . .PP May croak with a Glib::Error in $@ on failure. .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBnew_from_xpm_data\fP (...)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->new_from_xpm_data (...)" .IP "\(bu" 4 \&... (list) xpm data as a list of strings (see discussion) .PP X Pixel Map (\s-1XPM\s0) files are designed to be easy to edit and easy to include directly into C programs. The file format is the C syntax of the declaration and initialization of a variable containing an array of strings. \&\f(CW\*(C`new_from_xpm_data\*(C'\fR allows you to create an image from such data included directly in your program source. .PP Since \s-1XPM\s0 files are C syntax, you must mangle that source a bit to work in a Perl program. For example, this is a valid xpm, but it is not valid Perl code: .PP .Vb 10 \& /* XPM */ \& static char * test_xpm[] = { \& "4 4 3 1", \& " c None", \& ". c red", \& "+ c blue", \& ".. +", \& ". ++", \& " ++.", \& "++.."}; .Ve .PP You'll need to change the array declaration format, and change the double-quoted strings to single-quoted to avoid Perl interpreting any chars in the strings as special. .PP .Vb 9 \& my @test_xpm = ( \& \*(Aq4 4 3 1\*(Aq, \& \*(Aq c None\*(Aq, \& \*(Aq. c red\*(Aq, \& \*(Aq+ c blue\*(Aq, \& \*(Aq.. +\*(Aq, \& \*(Aq. ++\*(Aq, \& \*(Aq ++.\*(Aq, \& \*(Aq++..\*(Aq); \& \& $pixbuf = Gtk2::Gdk::Pixbuf\->new_from_xpm_data (@test_xpm); .Ve .PP [It's only two or three regexes... Perhaps we should distribute a script to convert \s-1XPM\s0 files to the proper format?] .ie n .SS "pixbuf = $src_pixbuf\->\fBnew_subpixbuf\fP ($src_x, $src_y, $width, $height)" .el .SS "pixbuf = \f(CW$src_pixbuf\fP\->\fBnew_subpixbuf\fP ($src_x, \f(CW$src_y\fP, \f(CW$width\fP, \f(CW$height\fP)" .IX Subsection "pixbuf = $src_pixbuf->new_subpixbuf ($src_x, $src_y, $width, $height)" .IP "\(bu" 4 \&\f(CW$src_x\fR (integer) .IP "\(bu" 4 \&\f(CW$src_y\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .ie n .SS "pixbuf = $pixbuf\->\fBadd_alpha\fP ($substitute_color, $r, $g, $b)" .el .SS "pixbuf = \f(CW$pixbuf\fP\->\fBadd_alpha\fP ($substitute_color, \f(CW$r\fP, \f(CW$g\fP, \f(CW$b\fP)" .IX Subsection "pixbuf = $pixbuf->add_alpha ($substitute_color, $r, $g, $b)" .IP "\(bu" 4 \&\f(CW$substitute_color\fR (boolean) .IP "\(bu" 4 \&\f(CW$r\fR (Glib::UChar) .IP "\(bu" 4 \&\f(CW$g\fR (Glib::UChar) .IP "\(bu" 4 \&\f(CW$b\fR (Glib::UChar) .ie n .SS "pixbuf = $src\->\fBapply_embedded_orientation\fP" .el .SS "pixbuf = \f(CW$src\fP\->\fBapply_embedded_orientation\fP" .IX Subsection "pixbuf = $src->apply_embedded_orientation" Since: gtk+ 2.11 .ie n .SS "integer = $pixbuf\->\fBget_bits_per_sample\fP" .el .SS "integer = \f(CW$pixbuf\fP\->\fBget_bits_per_sample\fP" .IX Subsection "integer = $pixbuf->get_bits_per_sample" .ie n .SS "colorspace = $pixbuf\->\fBget_colorspace\fP" .el .SS "colorspace = \f(CW$pixbuf\fP\->\fBget_colorspace\fP" .IX Subsection "colorspace = $pixbuf->get_colorspace" .ie n .SS "$src\->\fBcomposite\fP ($dest, $dest_x, $dest_y, $dest_width, $dest_height, $offset_x, $offset_y, $scale_x, $scale_y, $interp_type, $overall_alpha)" .el .SS "\f(CW$src\fP\->\fBcomposite\fP ($dest, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$dest_width\fP, \f(CW$dest_height\fP, \f(CW$offset_x\fP, \f(CW$offset_y\fP, \f(CW$scale_x\fP, \f(CW$scale_y\fP, \f(CW$interp_type\fP, \f(CW$overall_alpha\fP)" .IX Subsection "$src->composite ($dest, $dest_x, $dest_y, $dest_width, $dest_height, $offset_x, $offset_y, $scale_x, $scale_y, $interp_type, $overall_alpha)" .IP "\(bu" 4 \&\f(CW$dest\fR (Gtk2::Gdk::Pixbuf) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_width\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_height\fR (integer) .IP "\(bu" 4 \&\f(CW$offset_x\fR (double) .IP "\(bu" 4 \&\f(CW$offset_y\fR (double) .IP "\(bu" 4 \&\f(CW$scale_x\fR (double) .IP "\(bu" 4 \&\f(CW$scale_y\fR (double) .IP "\(bu" 4 \&\f(CW$interp_type\fR (Gtk2::Gdk::InterpType) .IP "\(bu" 4 \&\f(CW$overall_alpha\fR (integer) .ie n .SS "$src\->\fBcomposite_color\fP ($dest, $dest_x, $dest_y, $dest_width, $dest_height, $offset_x, $offset_y, $scale_x, $scale_y, $interp_type, $overall_alpha, $check_x, $check_y, $check_size, $color1, $color2)" .el .SS "\f(CW$src\fP\->\fBcomposite_color\fP ($dest, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$dest_width\fP, \f(CW$dest_height\fP, \f(CW$offset_x\fP, \f(CW$offset_y\fP, \f(CW$scale_x\fP, \f(CW$scale_y\fP, \f(CW$interp_type\fP, \f(CW$overall_alpha\fP, \f(CW$check_x\fP, \f(CW$check_y\fP, \f(CW$check_size\fP, \f(CW$color1\fP, \f(CW$color2\fP)" .IX Subsection "$src->composite_color ($dest, $dest_x, $dest_y, $dest_width, $dest_height, $offset_x, $offset_y, $scale_x, $scale_y, $interp_type, $overall_alpha, $check_x, $check_y, $check_size, $color1, $color2)" .IP "\(bu" 4 \&\f(CW$dest\fR (Gtk2::Gdk::Pixbuf) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_width\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_height\fR (integer) .IP "\(bu" 4 \&\f(CW$offset_x\fR (double) .IP "\(bu" 4 \&\f(CW$offset_y\fR (double) .IP "\(bu" 4 \&\f(CW$scale_x\fR (double) .IP "\(bu" 4 \&\f(CW$scale_y\fR (double) .IP "\(bu" 4 \&\f(CW$interp_type\fR (Gtk2::Gdk::InterpType) .IP "\(bu" 4 \&\f(CW$overall_alpha\fR (integer) .IP "\(bu" 4 \&\f(CW$check_x\fR (integer) .IP "\(bu" 4 \&\f(CW$check_y\fR (integer) .IP "\(bu" 4 \&\f(CW$check_size\fR (integer) .IP "\(bu" 4 \&\f(CW$color1\fR (unsigned) .IP "\(bu" 4 \&\f(CW$color2\fR (unsigned) .ie n .SS "pixbuf or undef = $src\->\fBcomposite_color_simple\fP ($dest_width, $dest_height, $interp_type, $overall_alpha, $check_size, $color1, $color2)" .el .SS "pixbuf or undef = \f(CW$src\fP\->\fBcomposite_color_simple\fP ($dest_width, \f(CW$dest_height\fP, \f(CW$interp_type\fP, \f(CW$overall_alpha\fP, \f(CW$check_size\fP, \f(CW$color1\fP, \f(CW$color2\fP)" .IX Subsection "pixbuf or undef = $src->composite_color_simple ($dest_width, $dest_height, $interp_type, $overall_alpha, $check_size, $color1, $color2)" .IP "\(bu" 4 \&\f(CW$dest_width\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_height\fR (integer) .IP "\(bu" 4 \&\f(CW$interp_type\fR (Gtk2::Gdk::InterpType) .IP "\(bu" 4 \&\f(CW$overall_alpha\fR (integer) .IP "\(bu" 4 \&\f(CW$check_size\fR (integer) .IP "\(bu" 4 \&\f(CW$color1\fR (unsigned) .IP "\(bu" 4 \&\f(CW$color2\fR (unsigned) .ie n .SS "pixbuf = $pixbuf\->\fBcopy\fP" .el .SS "pixbuf = \f(CW$pixbuf\fP\->\fBcopy\fP" .IX Subsection "pixbuf = $pixbuf->copy" .ie n .SS "$src_pixbuf\->\fBcopy_area\fP ($src_x, $src_y, $width, $height, $dest_pixbuf, $dest_x, $dest_y)" .el .SS "\f(CW$src_pixbuf\fP\->\fBcopy_area\fP ($src_x, \f(CW$src_y\fP, \f(CW$width\fP, \f(CW$height\fP, \f(CW$dest_pixbuf\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP)" .IX Subsection "$src_pixbuf->copy_area ($src_x, $src_y, $width, $height, $dest_pixbuf, $dest_x, $dest_y)" .IP "\(bu" 4 \&\f(CW$src_x\fR (integer) .IP "\(bu" 4 \&\f(CW$src_y\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_pixbuf\fR (Gtk2::Gdk::Pixbuf) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .ie n .SS "(format, width, height) = $pixbuf\->\fBget_file_info\fP ($filename)" .el .SS "(format, width, height) = \f(CW$pixbuf\fP\->\fBget_file_info\fP ($filename)" .IX Subsection "(format, width, height) = $pixbuf->get_file_info ($filename)" .IP "\(bu" 4 \&\f(CW$filename\fR (localized file name) .PP Parses enough of \fI\f(CI$filename\fI\fR to determine and return the format and size. If the format is unknown or the file can't be opened, returns an empty list. .PP Since: gtk+ 2.4 .ie n .SS "$pixbuf\->\fBfill\fP ($pixel)" .el .SS "\f(CW$pixbuf\fP\->\fBfill\fP ($pixel)" .IX Subsection "$pixbuf->fill ($pixel)" .IP "\(bu" 4 \&\f(CW$pixel\fR (unsigned) a packed \s-1RGBA\s0 value. .PP Clear \fI\f(CI$pixbuf\fI\fR to contain only the value given in \fI\f(CI$pixel\fI\fR. .ie n .SS "pixbuf = $src\->\fBflip\fP ($horizontal)" .el .SS "pixbuf = \f(CW$src\fP\->\fBflip\fP ($horizontal)" .IX Subsection "pixbuf = $src->flip ($horizontal)" .IP "\(bu" 4 \&\f(CW$horizontal\fR (boolean) .PP Since: gtk+ 2.6 .SS "list = Gtk2::Gdk::Pixbuf\->\fBget_formats\fP" .IX Subsection "list = Gtk2::Gdk::Pixbuf->get_formats" Returns a list of hashes with information about the formats supported by Gtk2::Gdk::Pixbuf. .PP Since: gtk+ 2.2 .ie n .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBget_from_drawable\fP ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .el .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBget_from_drawable\fP ($src, \f(CW$cmap\fP, \f(CW$src_x\fP, \f(CW$src_y\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$width\fP, \f(CW$height\fP)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->get_from_drawable ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .ie n .SS "pixbuf = $pixbuf\->\fBget_from_drawable\fP ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .el .SS "pixbuf = \f(CW$pixbuf\fP\->\fBget_from_drawable\fP ($src, \f(CW$cmap\fP, \f(CW$src_x\fP, \f(CW$src_y\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$width\fP, \f(CW$height\fP)" .IX Subsection "pixbuf = $pixbuf->get_from_drawable ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .IP "\(bu" 4 \&\f(CW$src\fR (Gtk2::Gdk::Drawable) .IP "\(bu" 4 \&\f(CW$cmap\fR (Gtk2::Gdk::Colormap or undef) .IP "\(bu" 4 \&\f(CW$src_x\fR (integer) .IP "\(bu" 4 \&\f(CW$src_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .PP Fetch pixels from a Gtk2::Gdk::Drawable as a Gtk2::Gdk::Pixbuf. Returns a new Gtk2::Gdk::Pixbuf if you use the class form, or \fI\f(CI$pixbuf\fI\fR if you call it on an existing pixbuf. .ie n .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBget_from_image\fP ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .el .SS "pixbuf = Gtk2::Gdk::Pixbuf\->\fBget_from_image\fP ($src, \f(CW$cmap\fP, \f(CW$src_x\fP, \f(CW$src_y\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$width\fP, \f(CW$height\fP)" .IX Subsection "pixbuf = Gtk2::Gdk::Pixbuf->get_from_image ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .ie n .SS "pixbuf = $pixbuf\->\fBget_from_image\fP ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .el .SS "pixbuf = \f(CW$pixbuf\fP\->\fBget_from_image\fP ($src, \f(CW$cmap\fP, \f(CW$src_x\fP, \f(CW$src_y\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$width\fP, \f(CW$height\fP)" .IX Subsection "pixbuf = $pixbuf->get_from_image ($src, $cmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height)" .IP "\(bu" 4 \&\f(CW$src\fR (Gtk2::Gdk::Image) .IP "\(bu" 4 \&\f(CW$cmap\fR (Gtk2::Gdk::Colormap or undef) .IP "\(bu" 4 \&\f(CW$src_x\fR (integer) .IP "\(bu" 4 \&\f(CW$src_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .PP Fetch pixels from a Gtk2::Gdk::Image as a Gtk2::Gdk::Pixbuf. Returns a new Gtk2::Gdk::Pixbuf if you use the class form, or \fI\f(CI$pixbuf\fI\fR if you call it on an existing pixbuf. .ie n .SS "boolean = $pixbuf\->\fBget_has_alpha\fP" .el .SS "boolean = \f(CW$pixbuf\fP\->\fBget_has_alpha\fP" .IX Subsection "boolean = $pixbuf->get_has_alpha" .ie n .SS "integer = $pixbuf\->\fBget_height\fP" .el .SS "integer = \f(CW$pixbuf\fP\->\fBget_height\fP" .IX Subsection "integer = $pixbuf->get_height" .ie n .SS "integer = $pixbuf\->\fBget_n_channels\fP" .el .SS "integer = \f(CW$pixbuf\fP\->\fBget_n_channels\fP" .IX Subsection "integer = $pixbuf->get_n_channels" .ie n .SS "string or undef = $pixbuf\->\fBget_option\fP ($key)" .el .SS "string or undef = \f(CW$pixbuf\fP\->\fBget_option\fP ($key)" .IX Subsection "string or undef = $pixbuf->get_option ($key)" .IP "\(bu" 4 \&\f(CW$key\fR (string) .ie n .SS "boolean = $pixbuf\->\fBset_option\fP ($key, $value)" .el .SS "boolean = \f(CW$pixbuf\fP\->\fBset_option\fP ($key, \f(CW$value\fP)" .IX Subsection "boolean = $pixbuf->set_option ($key, $value)" .IP "\(bu" 4 \&\f(CW$key\fR (string) .IP "\(bu" 4 \&\f(CW$value\fR (string) .PP Since: gtk+ 2.2 .ie n .SS "scalar = $pixbuf\->\fBget_pixels\fP" .el .SS "scalar = \f(CW$pixbuf\fP\->\fBget_pixels\fP" .IX Subsection "scalar = $pixbuf->get_pixels" Return a copy of the bytes comprising the pixel data of \f(CW$pixbuf\fR. .PP As described in the Gdk Pixbuf reference manual (the \*(L"Note\*(R" section of \&\*(L"The GdkPixbuf Structure\*(R"), the last row does not extend to the rowstride, but ends with the last byte of the last pixel. The length of the \f(CW\*(C`get_pixels\*(C'\fR return reflects this. .ie n .SS "pixmap = $pixbuf\->\fBrender_pixmap_and_mask\fP ($alpha_threshold)" .el .SS "pixmap = \f(CW$pixbuf\fP\->\fBrender_pixmap_and_mask\fP ($alpha_threshold)" .IX Subsection "pixmap = $pixbuf->render_pixmap_and_mask ($alpha_threshold)" .ie n .SS "(pixmap, mask) = $pixbuf\->\fBrender_pixmap_and_mask\fP ($alpha_threshold)" .el .SS "(pixmap, mask) = \f(CW$pixbuf\fP\->\fBrender_pixmap_and_mask\fP ($alpha_threshold)" .IX Subsection "(pixmap, mask) = $pixbuf->render_pixmap_and_mask ($alpha_threshold)" .IP "\(bu" 4 \&\f(CW$alpha_threshold\fR (integer) .ie n .SS "pixmap = $pixbuf\->\fBrender_pixmap_and_mask_for_colormap\fP ($colormap, $alpha_threshold)" .el .SS "pixmap = \f(CW$pixbuf\fP\->\fBrender_pixmap_and_mask_for_colormap\fP ($colormap, \f(CW$alpha_threshold\fP)" .IX Subsection "pixmap = $pixbuf->render_pixmap_and_mask_for_colormap ($colormap, $alpha_threshold)" .ie n .SS "(pixmap, mask) = $pixbuf\->\fBrender_pixmap_and_mask_for_colormap\fP ($colormap, $alpha_threshold)" .el .SS "(pixmap, mask) = \f(CW$pixbuf\fP\->\fBrender_pixmap_and_mask_for_colormap\fP ($colormap, \f(CW$alpha_threshold\fP)" .IX Subsection "(pixmap, mask) = $pixbuf->render_pixmap_and_mask_for_colormap ($colormap, $alpha_threshold)" .IP "\(bu" 4 \&\f(CW$colormap\fR (Gtk2::Gdk::Colormap) .IP "\(bu" 4 \&\f(CW$alpha_threshold\fR (integer) .ie n .SS "$pixbuf\->\fBrender_threshold_alpha\fP ($bitmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height, $alpha_threshold)" .el .SS "\f(CW$pixbuf\fP\->\fBrender_threshold_alpha\fP ($bitmap, \f(CW$src_x\fP, \f(CW$src_y\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$width\fP, \f(CW$height\fP, \f(CW$alpha_threshold\fP)" .IX Subsection "$pixbuf->render_threshold_alpha ($bitmap, $src_x, $src_y, $dest_x, $dest_y, $width, $height, $alpha_threshold)" .IP "\(bu" 4 \&\f(CW$bitmap\fR (Gtk2::Gdk::Bitmap) .IP "\(bu" 4 \&\f(CW$src_x\fR (integer) .IP "\(bu" 4 \&\f(CW$src_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .IP "\(bu" 4 \&\f(CW$alpha_threshold\fR (integer) .ie n .SS "$pixbuf\->\fBrender_to_drawable\fP ($drawable, $gc, $src_x, $src_y, $dest_x, $dest_y, $width, $height, $dither, $x_dither, $y_dither)" .el .SS "\f(CW$pixbuf\fP\->\fBrender_to_drawable\fP ($drawable, \f(CW$gc\fP, \f(CW$src_x\fP, \f(CW$src_y\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$width\fP, \f(CW$height\fP, \f(CW$dither\fP, \f(CW$x_dither\fP, \f(CW$y_dither\fP)" .IX Subsection "$pixbuf->render_to_drawable ($drawable, $gc, $src_x, $src_y, $dest_x, $dest_y, $width, $height, $dither, $x_dither, $y_dither)" .IP "\(bu" 4 \&\f(CW$drawable\fR (Gtk2::Gdk::Drawable) .IP "\(bu" 4 \&\f(CW$gc\fR (Gtk2::Gdk::GC) .IP "\(bu" 4 \&\f(CW$src_x\fR (integer) .IP "\(bu" 4 \&\f(CW$src_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .IP "\(bu" 4 \&\f(CW$dither\fR (Gtk2::Gdk::RgbDither) .IP "\(bu" 4 \&\f(CW$x_dither\fR (integer) .IP "\(bu" 4 \&\f(CW$y_dither\fR (integer) .ie n .SS "$pixbuf\->\fBrender_to_drawable_alpha\fP ($drawable, $src_x, $src_y, $dest_x, $dest_y, $width, $height, $alpha_mode, $alpha_threshold, $dither, $x_dither, $y_dither)" .el .SS "\f(CW$pixbuf\fP\->\fBrender_to_drawable_alpha\fP ($drawable, \f(CW$src_x\fP, \f(CW$src_y\fP, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$width\fP, \f(CW$height\fP, \f(CW$alpha_mode\fP, \f(CW$alpha_threshold\fP, \f(CW$dither\fP, \f(CW$x_dither\fP, \f(CW$y_dither\fP)" .IX Subsection "$pixbuf->render_to_drawable_alpha ($drawable, $src_x, $src_y, $dest_x, $dest_y, $width, $height, $alpha_mode, $alpha_threshold, $dither, $x_dither, $y_dither)" .IP "\(bu" 4 \&\f(CW$drawable\fR (Gtk2::Gdk::Drawable) .IP "\(bu" 4 \&\f(CW$src_x\fR (integer) .IP "\(bu" 4 \&\f(CW$src_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$width\fR (integer) .IP "\(bu" 4 \&\f(CW$height\fR (integer) .IP "\(bu" 4 \&\f(CW$alpha_mode\fR (Gtk2::Gdk::PixbufAlphaMode) .IP "\(bu" 4 \&\f(CW$alpha_threshold\fR (integer) .IP "\(bu" 4 \&\f(CW$dither\fR (Gtk2::Gdk::RgbDither) .IP "\(bu" 4 \&\f(CW$x_dither\fR (integer) .IP "\(bu" 4 \&\f(CW$y_dither\fR (integer) .ie n .SS "pixbuf = $src\->\fBrotate_simple\fP ($angle)" .el .SS "pixbuf = \f(CW$src\fP\->\fBrotate_simple\fP ($angle)" .IX Subsection "pixbuf = $src->rotate_simple ($angle)" .IP "\(bu" 4 \&\f(CW$angle\fR (Gtk2::Gdk::PixbufRotation) .PP Since: gtk+ 2.6 .ie n .SS "integer = $pixbuf\->\fBget_rowstride\fP" .el .SS "integer = \f(CW$pixbuf\fP\->\fBget_rowstride\fP" .IX Subsection "integer = $pixbuf->get_rowstride" .ie n .SS "$src\->\fBsaturate_and_pixelate\fP ($dest, $saturation, $pixelate)" .el .SS "\f(CW$src\fP\->\fBsaturate_and_pixelate\fP ($dest, \f(CW$saturation\fP, \f(CW$pixelate\fP)" .IX Subsection "$src->saturate_and_pixelate ($dest, $saturation, $pixelate)" .IP "\(bu" 4 \&\f(CW$dest\fR (Gtk2::Gdk::Pixbuf) .IP "\(bu" 4 \&\f(CW$saturation\fR (double) .IP "\(bu" 4 \&\f(CW$pixelate\fR (boolean) .ie n .SS "$pixbuf\->\fBsave\fP ($filename, $type, ...)" .el .SS "\f(CW$pixbuf\fP\->\fBsave\fP ($filename, \f(CW$type\fP, ...)" .IX Subsection "$pixbuf->save ($filename, $type, ...)" .IP "\(bu" 4 \&\f(CW$filename\fR (localized file name) .IP "\(bu" 4 \&\f(CW$type\fR (string) name of file format (e.g. \*(L"jpeg\*(R", \*(L"png\*(R") .IP "\(bu" 4 \&... (list) list of key-value save options .PP Save \fI\f(CI$pixbuf\fI\fR to a file named \fI\f(CI$filename\fI\fR, in the format \fI\f(CI$type\fI\fR, which is currently \*(L"jpeg\*(R" or \*(L"png\*(R". The function will croak if there is an error, which may arise from file\- or image format-related issues. .PP Any values in \fI...\fR should be key/value string pairs that modify the saving parameters. For example: .PP .Vb 1 \& $pixbuf\->save ($filename, \*(Aqjpeg\*(Aq, quality => \*(Aq100\*(Aq); .Ve .PP Currently only a few parameters exist. \s-1JPEG\s0 images can be saved with a \&\*(L"quality\*(R" parameter; its value should be in the range [0,100]. Text chunks can be attached to \s-1PNG\s0 images by specifying parameters of the form \*(L"tEXt::key\*(R", where key is an \s-1ASCII\s0 string of length 1\-79. The values are \s-1UTF\-8\s0 encoded strings. (This is a quote from the C \s-1API\s0 reference; note that the C \s-1API\s0 reference is the canonical source for this information.) .PP May croak with a Glib::Error in $@ on failure. .ie n .SS "scalar = $pixbuf\->\fBsave_to_buffer\fP ($type, ...)" .el .SS "scalar = \f(CW$pixbuf\fP\->\fBsave_to_buffer\fP ($type, ...)" .IX Subsection "scalar = $pixbuf->save_to_buffer ($type, ...)" .IP "\(bu" 4 \&\f(CW$type\fR (string) name of file format (e.g. \*(L"jpeg\*(R", \*(L"png\*(R") .IP "\(bu" 4 \&... (list) list of key-value save options .PP Save \fI\f(CI$pixbuf\fI\fR to a scalar buffer, in the format \fI\f(CI$type\fI\fR, which is currently \&\*(L"jpeg\*(R" or \*(L"png\*(R". The function will croak if there is an error, which may arise from image format-related issues. .PP The returned string contains binary data, which may have embedded nuls. Don't try to \f(CW\*(C`print\*(C'\fR it. .PP See \f(CW\*(C`Gtk2::Gdk::Pixbuf::save\*(C'\fR for more details. .PP May croak with a Glib::Error in $@ on failure. .PP Since: gtk+ 2.4 .ie n .SS "$src\->\fBscale\fP ($dest, $dest_x, $dest_y, $dest_width, $dest_height, $offset_x, $offset_y, $scale_x, $scale_y, $interp_type)" .el .SS "\f(CW$src\fP\->\fBscale\fP ($dest, \f(CW$dest_x\fP, \f(CW$dest_y\fP, \f(CW$dest_width\fP, \f(CW$dest_height\fP, \f(CW$offset_x\fP, \f(CW$offset_y\fP, \f(CW$scale_x\fP, \f(CW$scale_y\fP, \f(CW$interp_type\fP)" .IX Subsection "$src->scale ($dest, $dest_x, $dest_y, $dest_width, $dest_height, $offset_x, $offset_y, $scale_x, $scale_y, $interp_type)" .IP "\(bu" 4 \&\f(CW$dest\fR (Gtk2::Gdk::Pixbuf) .IP "\(bu" 4 \&\f(CW$dest_x\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_y\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_width\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_height\fR (integer) .IP "\(bu" 4 \&\f(CW$offset_x\fR (double) .IP "\(bu" 4 \&\f(CW$offset_y\fR (double) .IP "\(bu" 4 \&\f(CW$scale_x\fR (double) .IP "\(bu" 4 \&\f(CW$scale_y\fR (double) .IP "\(bu" 4 \&\f(CW$interp_type\fR (Gtk2::Gdk::InterpType) .ie n .SS "pixbuf or undef = $src\->\fBscale_simple\fP ($dest_width, $dest_height, $interp_type)" .el .SS "pixbuf or undef = \f(CW$src\fP\->\fBscale_simple\fP ($dest_width, \f(CW$dest_height\fP, \f(CW$interp_type\fP)" .IX Subsection "pixbuf or undef = $src->scale_simple ($dest_width, $dest_height, $interp_type)" .IP "\(bu" 4 \&\f(CW$dest_width\fR (integer) .IP "\(bu" 4 \&\f(CW$dest_height\fR (integer) .IP "\(bu" 4 \&\f(CW$interp_type\fR (Gtk2::Gdk::InterpType) .ie n .SS "integer = $pixbuf\->\fBget_width\fP" .el .SS "integer = \f(CW$pixbuf\fP\->\fBget_width\fP" .IX Subsection "integer = $pixbuf->get_width" .SH "PROPERTIES" .IX Header "PROPERTIES" .IP "'bits\-per\-sample' (integer : default 8 : readable / writable / construct-only / private)" 4 .IX Item "'bits-per-sample' (integer : default 8 : readable / writable / construct-only / private)" The number of bits per sample .ie n .IP "'colorspace' (Gtk2::Gdk::Colorspace : default ""rgb"" : readable / writable / construct-only / private)" 4 .el .IP "'colorspace' (Gtk2::Gdk::Colorspace : default ``rgb'' : readable / writable / construct-only / private)" 4 .IX Item "'colorspace' (Gtk2::Gdk::Colorspace : default rgb : readable / writable / construct-only / private)" The colorspace in which the samples are interpreted .IP "'has\-alpha' (boolean : default false : readable / writable / construct-only / private)" 4 .IX Item "'has-alpha' (boolean : default false : readable / writable / construct-only / private)" Whether the pixbuf has an alpha channel .IP "'height' (integer : default 1 : readable / writable / construct-only / private)" 4 .IX Item "'height' (integer : default 1 : readable / writable / construct-only / private)" The number of rows of the pixbuf .IP "'n\-channels' (integer : default 3 : readable / writable / construct-only / private)" 4 .IX Item "'n-channels' (integer : default 3 : readable / writable / construct-only / private)" The number of samples per pixel .IP "'pixel\-bytes' (Glib::Bytes : default undef : readable / writable / construct-only / private)" 4 .IX Item "'pixel-bytes' (Glib::Bytes : default undef : readable / writable / construct-only / private)" Readonly pixel data .IP "'pixels' (gpointer : default 0 : readable / writable / construct-only / private)" 4 .IX Item "'pixels' (gpointer : default 0 : readable / writable / construct-only / private)" A pointer to the pixel data of the pixbuf .IP "'rowstride' (integer : default 1 : readable / writable / construct-only / private)" 4 .IX Item "'rowstride' (integer : default 1 : readable / writable / construct-only / private)" The number of bytes between the start of a row and the start of the next row .IP "'width' (integer : default 1 : readable / writable / construct-only / private)" 4 .IX Item "'width' (integer : default 1 : readable / writable / construct-only / private)" The number of columns of the pixbuf .SH "ENUMS AND FLAGS" .IX Header "ENUMS AND FLAGS" .SS "enum Gtk2::Gdk::Colorspace" .IX Subsection "enum Gtk2::Gdk::Colorspace" .IP "\(bu" 4 \&'rgb' / '\s-1GDK_COLORSPACE_RGB\s0' .SS "enum Gtk2::Gdk::InterpType" .IX Subsection "enum Gtk2::Gdk::InterpType" .IP "\(bu" 4 \&'nearest' / '\s-1GDK_INTERP_NEAREST\s0' .IP "\(bu" 4 \&'tiles' / '\s-1GDK_INTERP_TILES\s0' .IP "\(bu" 4 \&'bilinear' / '\s-1GDK_INTERP_BILINEAR\s0' .IP "\(bu" 4 \&'hyper' / '\s-1GDK_INTERP_HYPER\s0' .SS "enum Gtk2::Gdk::PixbufAlphaMode" .IX Subsection "enum Gtk2::Gdk::PixbufAlphaMode" .IP "\(bu" 4 \&'bilevel' / '\s-1GDK_PIXBUF_ALPHA_BILEVEL\s0' .IP "\(bu" 4 \&'full' / '\s-1GDK_PIXBUF_ALPHA_FULL\s0' .SS "enum Gtk2::Gdk::PixbufError" .IX Subsection "enum Gtk2::Gdk::PixbufError" .IP "\(bu" 4 \&'corrupt\-image' / '\s-1GDK_PIXBUF_ERROR_CORRUPT_IMAGE\s0' .IP "\(bu" 4 \&'insufficient\-memory' / '\s-1GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY\s0' .IP "\(bu" 4 \&'bad\-option' / '\s-1GDK_PIXBUF_ERROR_BAD_OPTION\s0' .IP "\(bu" 4 \&'unknown\-type' / '\s-1GDK_PIXBUF_ERROR_UNKNOWN_TYPE\s0' .IP "\(bu" 4 \&'unsupported\-operation' / '\s-1GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION\s0' .IP "\(bu" 4 \&'failed' / '\s-1GDK_PIXBUF_ERROR_FAILED\s0' .IP "\(bu" 4 \&'incomplete\-animation' / '\s-1GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION\s0' .SS "enum Gtk2::Gdk::PixbufRotation" .IX Subsection "enum Gtk2::Gdk::PixbufRotation" .IP "\(bu" 4 \&'none' / '\s-1GDK_PIXBUF_ROTATE_NONE\s0' .IP "\(bu" 4 \&'counterclockwise' / '\s-1GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE\s0' .IP "\(bu" 4 \&'upsidedown' / '\s-1GDK_PIXBUF_ROTATE_UPSIDEDOWN\s0' .IP "\(bu" 4 \&'clockwise' / '\s-1GDK_PIXBUF_ROTATE_CLOCKWISE\s0' .SS "enum Gtk2::Gdk::RgbDither" .IX Subsection "enum Gtk2::Gdk::RgbDither" .IP "\(bu" 4 \&'none' / '\s-1GDK_RGB_DITHER_NONE\s0' .IP "\(bu" 4 \&'normal' / '\s-1GDK_RGB_DITHER_NORMAL\s0' .IP "\(bu" 4 \&'max' / '\s-1GDK_RGB_DITHER_MAX\s0' .SH "SEE ALSO" .IX Header "SEE ALSO" Gtk2, Glib::Object .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2003\-2011 by the gtk2\-perl team. .PP This software is licensed under the \s-1LGPL.\s0 See Gtk2 for a full notice.