Re: some errors related to draw_rgb_image
| From: | Decapode Azur | Date: | Sat, 29 Nov 2003 13:02:17 +0000 |
| Subject: | Re: some errors related to draw_rgb_image | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4257@lists.php.net to get a copy of this message | ||
> > if you use gdk::draw_rgb_image for visualizing RGB data from
> > imagick_convert($hdl,'RGB'), and dumping them with imagick_image2blob,
> > you can use 24bit color. in the absence of pixbuf under win32, there
> > could be this alternative.
> > but i don't know how use that function.
> >
> > the question is
> > utilizing data from a conversion
> > [..]
> > in some cases this function makes an error like:
> > string with zeros at place of string in gdk::draw_rgb_image
> [..]
> I have just tryed to put your code in 'pimg_inc/pimg.functionnal.inc.php'
> like this:
> function render_pixbuf_pixmapV3($area) {
> global $pixbuf, $width, $height;
>
> $window = $area->window;
> $gc = $window->new_gc();
> gdk::draw_rgb_image($window, $gc, 0,0, $width,$height,
> GDK_RGB_DITHER_NONE, $pixbuf, $width*3);
> }
> function handle2pixbuf_pixmapV3() {
> global $pixbuf, $handle;
>
> $image_data = imagick_image2blob ($handle);
> $pixbuf = $image_data;
> }
>
> It seems I have the same warning than you :
> draw_rgb_image expects argument 8 to be string without null bytes,
> string given ...
> [..]
> The only thing I have found in php_gtk_manual_fr.txt about it is:
> void gdk::draw_rgb_image(GdkWindow drawable, GdkGC gc , int x, int y,
> int width, int height, GdkRgbDither dith, string rgb_buf, int rowstride);
>
> No working sample exemple so I have searched in the list of the PHP-GTK
> apps to find one that uses this function to copy-past in my script, but I
> did not found anything.
>
> If someone want to help, just give me a sample code or give me a link to an
> existing app that use it, or to a doc, or you can try to hack this simple
> sample too:
>
> http://grincheux.codelutin.org/~monnier/pim/g/sample/imagick2gtk-sample.htm
>[..]
I have finaly found on gg something giving explanations on it:
http://frcatel.fri.utc.sk/pygtk2tutorial/sec-DrawingMethods.html
But I did not found how to use those in practice :-(
++
--
PS: a very good link to learn about gtk is this one:
http://personal.riverusers.com/~swilhelm/gtkperl-tutorial/
It is more easy to read this one for perl and translate for PHP
than reading gtk for C