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

GDK Reference Manual

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

  buf : The pixel data, represented as 8-bit color indices.

  rowstride : The number of bytes from the start of one row in buf to the start of the next.

  cmap : The GdkRgbCmap used to assign colors to the color indices.


gdk_draw_gray_image ()
voidgdk_draw_gray_image (GdkDrawable *drawable,
GdkGC *gc,gint x,gint y,gint width,gint height,
GdkRgbDither dith,guchar *buf,gint rowstride); 

  Draws a grayscale image in the drawable.

  drawable : The GdkDrawable to draw in (usually a GdkWindow).

  gc : The graphics context.

  x : The x coordinate of the top-left corner in the drawable.

  y : The y coordinate of the top-left corner in the drawable.

  width : The width of the rectangle to be drawn.

  height : The height of the rectangle to be drawn.

  dith : A GdkRgbDither value, selecting the desired dither mode.

  buf : The pixel data, represented as 8-bit gray values.

  rowstride : The number of bytes from the start of one row in buf to the start of the next.


gdk_draw_rgb_32_image ()
voidgdk_draw_rgb_32_image (GdkDrawable *drawable,
GdkGC *gc,gint x,gint y,gint width,gint height,
GdkRgbDither dith,guchar *buf,gint rowstride); 

  Draws a padded RGB image in the drawable. The image is stored as one pixel per 32-bit word. It is laid out as a red byte, a green byte, a blue byte, and a padding byte.

  It's unlikely that this function will give significant performance gains in practice. In my experience, the performance gain from having pixels aligned to 32-bit boundaries is cancelled out by the increased memory bandwidth.

  drawable : The GdkDrawable to draw in (usually a GdkWindow).

  gc : The graphics context.

  x : The x coordinate of the top-left corner in the drawable.

  y : The y coordinate of the top-left corner in the drawable.

  width : The width of the rectangle to be drawn.

  height : The height of the rectangle to be drawn.

  dith : A GdkRgbDither value, selecting the desired dither mode.

  buf : The pixel data, represented as padded 32-bit data.

  rowstride : The number of bytes from the start of one row in buf to the start of the next.

  enum GdkRgbDither


typedef enum
{
GDK_RGB_DITHER_NONE,
GDK_RGB_DITHER_NORMAL,
GDK_RGB_DITHER_MAX
} GdkRgbDither; 

  Selects whether or not GdkRgb applies dithering to the image on display. There are three values:

  GDK_RGB_DITHER_NONE: Never use dithering.

  GDK_RGB_DITHER_NORMAL: Use dithering in 8 bits per pixel (and below) only.

  GDK_RGB_DITHER_MAX: Use dithering in 16 bits per pixel and below.

  Since GdkRgb currently only handles images with 8 bits per component, dithering on 24 bit per pixel displays is a moot point.


gdk_rgb_cmap_new ()
GdkRgbCmap* gdk_rgb_cmap_new(guint32 *colors,gint n_colors); 

  Creates a new GdkRgbCmap structure. The cmap maps color indexes to RGB colors. If n_colors is less than 256, then images containing color values greater than or equal to n_colors will produce undefined results, including possibly segfaults.

  colors : The colors, represented as 0xRRGGBB integer values.

  n_colors : The number of colors in the cmap.

  Returns : The newly created GdkRgbCmap


gdk_rgb_cmap_free ()
voidgdk_rgb_cmap_free (GdkRgbCmap *cmap); 

  Frees the memory associated with a GdkRgbCmap created by gdk_rgb_cmap_new().

  cmap : The GdkRgbCmap to free.

  struct GdkRgbCmap


struct GdkRgbCmap {
guint32 colors[256];
guchar lut[256]; /* for 8-bit modes */
}; 

  A private data structure which maps color indices to actual RGB colors. This is used only for gdk_draw_indexed_image().


gdk_rgb_gc_set_foreground ()
voidgdk_rgb_gc_set_foreground (GdkGC *gc,guint32 rgb); 

  Sets the foreground 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.

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



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

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