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

GDK Reference Manual

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

  Name

  Bitmaps and Pixmaps -- Offscreen drawables.

  Synopsis


#include <gdk/gdk.h>
structGdkPixmap;
GdkPixmap*gdk_pixmap_new(GdkWindow *window,
gint width,gint height,gint depth);
GdkBitmap*gdk_bitmap_create_from_data (GdkWindow *window,
const gchar *data,gint width,gint height);
GdkPixmap*gdk_pixmap_create_from_data (GdkWindow *window,
const gchar *data,gint width,gint height,
gint depth,GdkColor *fg,GdkColor *bg);
GdkPixmap*gdk_pixmap_create_from_xpm(GdkWindow *window,
GdkBitmap **mask,GdkColor *transparent_color,const gchar *filename);
GdkPixmap*gdk_pixmap_colormap_create_from_xpm
(GdkWindow *window,GdkColormap *colormap,GdkBitmap **mask,
GdkColor *transparent_color,const gchar *filename);
GdkPixmap*gdk_pixmap_create_from_xpm_d(GdkWindow *window,
GdkBitmap **mask,GdkColor *transparent_color,gchar **data);
GdkPixmap*gdk_pixmap_colormap_create_from_xpm_d
(GdkWindow *window,GdkColormap *colormap,
GdkBitmap **mask,GdkColor *transparent_color,gchar **data);
GdkPixmap*gdk_pixmap_ref(GdkPixmap *pixmap);
voidgdk_pixmap_unref(GdkPixmap *pixmap);
structGdkBitmap;
GdkBitmap*gdk_bitmap_ref(GdkBitmap *pixmap);
voidgdk_bitmap_unref(GdkBitmap *pixmap); 

  Description

  Pixmaps are offscreen drawables. They can be drawn upon with the standard drawing primitives, then copied to another drawable (such as a GdkWindow) with gdk_pixmap_draw(). The depth of a pixmap is the number of bits per pixels. Bitmaps are simply pixmaps with a depth of 1. (That is, they are monochrome bitmaps - each pixel can be either on or off).

  Details

  struct GdkPixmap


struct GdkPixmap
{
gpointer user_data;
}; 

  An opaque structure representing an offscreen drawable. Pointers to structures of type GdkPixmap, GdkBitmap, and GdkWindow, can often be used interchangeably. The type GdkDrawable refers generically to any of these types.


gdk_pixmap_new ()
GdkPixmap*gdk_pixmap_new(GdkWindow *window,
gint width,gint height,gint depth); 

  Create a new pixmap with a given size and depth.

  window : a GdkWindow, used to determine default values for the new pixmap. Can be NULL if depth is specified,

  width : The width of the new pixmap in pixels.

  height : The height of the new pixmap in pixels.

  depth : The depth (number of bits per pixel) of the new pixmap. If -1, and window is not NULL, the depth of the new pixmap will be equal to that of window.

  Returns : the GdkBitmap


gdk_bitmap_create_from_data ()
GdkBitmap*gdk_bitmap_create_from_data (GdkWindow *window,
const gchar *data,gint width,gint height); 

  Creates a new bitmap from data in XBM format.

  window : a GdkWindow, used to determine default values for the new pixmap. Can be NULL, in which case the root window is used.

  data : a pointer to the XBM data.

  width : the width of the new pixmap in pixels.

  height : the height of the new pixmap in pixels.

  Returns : the GdkBitmap


gdk_pixmap_create_from_data ()
GdkPixmap*gdk_pixmap_create_from_data (GdkWindow *window,
const gchar *data,gint width,
gint height,gint depth,GdkColor *fg,GdkColor *bg); 

  Create a two-color pixmap from data in XBM data.

  window : a GdkWindow, used to determine default values for the new pixmap. Can be NULL, if the depth is given.

  data : a pointer to the data.

  width : the width of the new pixmap in pixels.

  height : the height of the new pixmap in pixels.

  depth : the depth (number of bits per pixel) of the new pixmap.

  fg : the foreground color.

  bg : the background color.

  Returns : the GdkPixmap


gdk_pixmap_create_from_xpm ()
GdkPixmap*gdk_pixmap_create_from_xpm(GdkWindow *window,
GdkBitmap **mask,GdkColor *transparent_color,const gchar *filename); 

  Create a pixmap from a XPM file.

  window : a GdkWindow, used to determine default values for the new pixmap.

  mask : a pointer to a place to store a bitmap representing the transparency mask of the XPM file. Can be NULL, in which case transparency will be ignored.

  transparent_color : the color to be used for the pixels that are transparent in the input file. Can be NULL, in which case a default color will be used.

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



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

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