GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Aug 25, 2016 11:41 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: XCreateImage () equivalent in gtk/gdk
PostPosted: Fri Dec 15, 2006 10:16 am 
Familiar Face

Joined: Fri Dec 08, 2006 6:44 am
Posts: 11

I have replaced a XCreateImage () call from my application(Mozilla source code) with an equivalent gdk API (gdk_image_new).. but the image quality is detioriated.
is there any much better substitution in GTK/GDK.

------------------------------------XCreateImage ()----------------------------------------------------------------
mAlphaXImage = XCreateImage(GDK_WINDOW_XDISPLAY(mAlphaPixmap),
1, /* visual depth...1 for bitmaps */
0, /* x offset, XXX fix this */
(char *)mAlphaBits, /* cast away our sign. */
32,/* bitmap pad */
mAlphaRowBytes); /* bytes per line */


/* Image library always places pixels left-to-right MSB to LSB */
mAlphaXImage->bitmap_bit_order = MSBFirst;

/* This definition doesn't depend on client byte ordering
because the image library ensures that the bytes in
bitmask data are arranged left to right on the screen,
low to high address in memory. */
mAlphaXImage->byte_order = MSBFirst;
------------------------------- gdk_image_new () ---------------------------------------
mAlphaXImage = gdk_image_new (GDK_IMAGE_FASTEST, gdk_rgb_get_visual(), aWidth, aHeight);
mAlphaXImage->mem = (char *)mAlphaBits;
mAlphaXImage->depth = 1;
mAlphaXImage->bpl = mAlphaRowBytes;
mAlphaXImage->bits_per_pixel = 1;
mAlphaXImage->byte_order = GDK_MSB_FIRST;

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group