PHP-GTK
Monday, December 22, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGdkPixbuf::saturate_and_pixelate
GdkPixbuf::scalenext

Last updated: Sun, 12 May 2013
view this page in English

GdkPixbuf::save

Saves the pixbuf into a file of a given type.

Example 10. Save a pixbuf into a file

<?php
//Create a new pixbuf of size 320x240
$pixbuf = new GdkPixbuf(Gdk::COLORSPACE_RGB, false, 8, 320, 240);
 
//green
$pixbuf->fill(128, 255, 0, 255);
 
//save it as a png file
$pixbuf->save('green.png', 'png');
?>

The optional third options can be a list of keys and values that depend on the output format. E.g., jpg has a quality parameter that defines the jpg quality from 0 to 100.

Example 11. Save a pixbuf into a jpg

<?php
//Create a new pixbuf of size 320x240
$pixbuf = new GdkPixbuf(Gdk::COLORSPACE_RGB, false, 8, 320, 240);
 
//green
$pixbuf->fill(128, 255, 0, 255);
 
//save it as a png file
$pixbuf->save('green.jpg', 'jpg', array('quality' => 85));
?>

User Contributed Notes
gdk.gdkpixbuf.method.save.php
add a note about notes
There are no user contributed notes for this page.


previousGdkPixbuf::saturate_and_pixelate
GdkPixbuf::scalenext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:50:55 2013 CEST