Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->系统管理 ->正文

GDK Reference Manual

来源:Linux-cn.com 作者:Webmaster 时间:2007-05-05 点击: [收藏] [投稿]


gdk_rgb_gc_set_background ()
voidgdk_rgb_gc_set_background (GdkGC *gc,guint32 rgb); 

  Sets the background color in gc to the specified color (or the closest approximation, in the case of limited visuals).

  gc : The GdkGC to modify.

  rgb : The color, represented as a 0xRRGGBB integer value.


gdk_rgb_xpixel_from_rgb ()
gulonggdk_rgb_xpixel_from_rgb (guint32 rgb); 

  Finds the X pixel closest in color to the rgb color specified. This value may be used to set the pixel field of a GdkColor struct.

  rgb : The color, represented as a 0xRRGGBB integer value.

  Returns : The X pixel value.


gdk_rgb_set_install ()
voidgdk_rgb_set_install (gboolean install); 

  If install is TRUE, directs GdkRgb to always install a new "private" colormap rather than trying to find a best fit with the colors already allocated. Ordinarily, GdkRgb will install a colormap only if a sufficient cube cannot be allocated.

  A private colormap has more colors, leading to better quality display, but also leads to the dreaded "colormap flashing" effect.

  install : TRUE to set install mode.


gdk_rgb_set_min_colors ()
voidgdk_rgb_set_min_colors(gint min_colors); 

  Sets the minimum number of colors for the color cube. Generally, GdkRgb tries to allocate the largest color cube it can. If it can't allocate a color cube at least as large as min_colors, it installs a private colormap.

  min_colors : The minimum number of colors accepted.


gdk_rgb_get_visual ()
GdkVisual*gdk_rgb_get_visual(void); 

  Gets the visual chosen by GdkRgb. This visual and the corresponding colormap should be used when creating windows that will be drawn in by GdkRgb.

  Returns : The GdkVisual chosen by GdkRgb.


gdk_rgb_get_cmap ()
GdkColormap* gdk_rgb_get_cmap (void); 

  Gets the colormap set by GdkRgb. This colormap and the corresponding visual should be used when creating windows that will be drawn in by GdkRgb.

  Returns : The GdkColormap set by GdkRgb.


gdk_rgb_ditherable ()
gbooleangdk_rgb_ditherable(void); 

  Determine whether the visual is ditherable. This function may be useful for presenting a user interface choice to the user about which dither mode is desired; if the display is not ditherable, it may make sense to gray out or hide the corresponding UI widget.

  Returns : TRUE if the visual is ditherable.


gdk_rgb_set_verbose ()
voidgdk_rgb_set_verbose (gboolean verbose); 

  Sets the "verbose" flag. This is generally only useful for debugging.

  verbose : TRUE if verbose messages are desired.

  See Also

  GdkColor

  The underlying Gdk mechanism for allocating colors.

  Images

  Name

  Images -- an area for bit-mapped graphics stored on the X Windows client.

  Synopsis


#include <gdk/gdk.h>
structGdkImage;
GdkImage* gdk_image_new (GdkImageType type,
GdkVisual *visual,gint width,gint height);
enumGdkImageType;
GdkImage* gdk_image_new_bitmap(GdkVisual *visual,
gpointer data,gint width,gint height);
GdkImage* gdk_image_get (GdkWindow *window,
gint x,gint y,gint width,gint height);
voidgdk_image_destroy (GdkImage *image);
voidgdk_image_put_pixel (GdkImage *image,
gint x,gint y,guint32 pixel);
guint32 gdk_image_get_pixel (GdkImage *image,gint x,gint y); 

  Description

  The GdkImage type represents an area for drawing graphics. It has now been superceded to a large extent by the much more flexible GdkRGB functions.

  To create an empty GdkImage use gdk_image_new(). To create a GdkImage from bitmap data use gdk_image_new_bitmap(). To create an image from part of a GdkWindow use gdk_image_get().

  The image can be manipulated with gdk_image_get_pixel() and gdk_image_put_pixel(), or alternatively by changing the actual pixel data. Though manipulating the pixel data requires complicated code to cope with the different formats that may be used.

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:GTK v1.2 Tutorial(英文)   下一篇:Java入门(12) 事件与错误处理

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号