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