GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Oct 26, 2014 5:10 am

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 
Offline
Familiar Face

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

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),
GDK_VISUAL_XVISUAL(gdk_rgb_get_visual()),
1, /* visual depth...1 for bitmaps */
XYPixmap,
0, /* x offset, XXX fix this */
(char *)mAlphaBits, /* cast away our sign. */
aWidth,
aHeight,
32,/* bitmap pad */
mAlphaRowBytes); /* bytes per line */

mAlphaXImage->bits_per_pixel=1;


/* 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;
-----------------------------------------------------------------------------------------------


Top
 Profile  
 
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: No registered users and 2 guests


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