[Glade-users] Windows printing problem.

Tristan Van Berkom tvb at gnome.org
Fri Aug 20 01:06:18 EDT 2010


GTK+ has different printing backends for win32/x11... you may
get a better/in depth answer if you ask on one of the GTK+ lists,
try gtk-app-devel-list at gnome.org.

(note that this list is about using the Glade interface designer tool).

Cheers,
            -Tristan

On Fri, Aug 20, 2010 at 12:04 AM, James <jamessteward at optusnet.com.au> wrote:
> Hi,
>
> I have an app that prints 2 pages with an image in one corner of the
> page, and some plotted data in the middle, the rest is text.
>
> The page is oriented in landscape.
>
> On Ubuntu the printing works fine.
>
> On Windows XP I can get the text only to work.
>
> Printing the image creates blank pages.
>
> Printing the plotted data causes printing errors.
>
> I'm using gtk+-bundle_2.18.7-20100213_win32
>
> Any clues?
>
> Code below.
>
> Regards,
> James.
>
>        pb = gdk_pixbuf_new_from_file("./Logo.jpg", &gerror);
>        if(!pb) {
>                eprintf("error message: %s\n", gerror->message);
>                return;
>        }
>
>        int pb_width = gdk_pixbuf_get_width (pb);
>        int pb_height = gdk_pixbuf_get_height (pb);
>
> //set to 1 makes the whole page blank on Win32, Linux fine.
> #if 0
>        cairo_surface_t *image = cairo_image_surface_create_for_data(
>                                        gdk_pixbuf_get_pixels(pb),
>                                        CAIRO_FORMAT_RGB24,
>                                        pb_width,
>                                        pb_height,
>                                        gdk_pixbuf_get_rowstride(pb));
>
>        do {
>                int rowstride, n_channels, x, y;
>                guchar *pixels, *p, tmp;
>
>                pixels = gdk_pixbuf_get_pixels (pb);
>                rowstride = gdk_pixbuf_get_rowstride(pb);
>                n_channels = gdk_pixbuf_get_n_channels (pb);
>
>                for (y = 0; y < pb_height; y++) {
>                        for (x = 0; x < pb_width; x++) {
>                                p = pixels + y * rowstride + x * n_channels;
>                                tmp = p[0];
>                                p[0] = p[2];
>                                p[2] = tmp;
>                        }
>                }
>        } while (0);
>
>        cairo_save (cr);
>        cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
>        cairo_set_source_surface(cr, image, 0, 0);
>        cairo_paint (cr);
>
>        cairo_restore (cr);
>
>
>        cairo_surface_destroy(image);
> #endif
>
>
> _______________________________________________
> Glade-users maillist  -  Glade-users at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users
>


More information about the Glade-users mailing list