Re: [imagick] converting to variable instead of file
| From: | Decapode Azur | Date: | Wed, 10 Sep 2003 16:25:59 +0000 |
| Subject: | Re: [imagick] converting to variable instead of file | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3857@lists.php.net to get a copy of this message | ||
> Don't try to view it through IE, it doesn't work. Fine on Netscape (and
> presumably many other non-MS offerings).
I've tried with the different browsers on linux : view those pages is very
hard (and could be consider as a real sport;) with Konqueror and also with
lin-Mozilla.
So I have switched to Links to browse those pages.
(I didn't try with opera, i should download it)
But I've just seen that it is fine with Galeon too (but surfing this links
is far more geek;) so I took the exemple from this page :
http://talks.php.net/show/kongress-gtk-csg/20
(below)
And got this error :
Fatal error: Undefined class name 'gdkpixbuf' in GtkPixbuf.php on line 14
Well where can I find this gdkpixbuf extention ?
Is there a CVS, a tarball, a rpm ?
If yes where can I find it ?
------------------------------------------------------------
<?php
dl('php_gtk.so');
if ($argc < 2) die("\tUsage: php gdk_pixbuf.php <imagefile>\n");
$image_file = $argv[1];
$window = &new GtkWindow();
$window->set_border_width(5);
$window->set_title('GdkPixbuf example');
$window->set_policy(false, false, true);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$pixbuf = GdkPixbuf::new_from_file($image_file);
if (!$pixbuf) die("\tCouldn't load $image_file\n");
$area = &new GtkDrawingArea();
$area->size($pixbuf->get_width(), $pixbuf->get_height());
$area->connect('expose_event', 'expose_event', $pixbuf);
$frame = &new GtkFrame();
$frame->add($area);
$frame->set_shadow_type(GTK_SHADOW_IN);
$window->add($frame);
$window->show_all();
gtk::main();
function expose_event($area, $event, $pixbuf) {
$pixbuf->render_to_drawable($area->window,
$area->style->fg_gc[GTK_STATE_NORMAL],
$event->area->x, $event->area->y,
$event->area->x, $event->area->y,
$event->area->width, $event->area->height,
GDK_RGB_DITHER_NORMAL, 0, 0);
}
?>