Chinaunix首页 | 论坛 | 博客
  • 博客访问: 181010
  • 博文数量: 96
  • 博客积分: 4060
  • 博客等级: 上校
  • 技术积分: 1040
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-12 13:13
文章分类

全部博文(96)

文章存档

2011年(3)

2010年(76)

2009年(17)

我的朋友

分类: LINUX

2010-06-08 16:39:37

gdkvisual:

A GdkVisual describes a particular video hardware display format. It includes information about the number of bits used for each color, the way the bits are translated into an RGB value for display, and the way the bits are stored in memory. For example, a piece of display hardware might support 24-bit color, 16-bit color, or 8-bit color; meaning 24/16/8-bit pixel sizes. For a given pixel size, pixels can be in different formats; for example the "red" element of an RGB pixel may be in the top 8 bits of the pixel, or may be in the lower 4 bits.

Usually you can avoid thinking about visuals in GTK+. Visuals are useful to interpret the contents of a GdkImage, but you should avoid GdkImage precisely because its contents depend on the display hardware; use GdkPixbuf instead, for all but the most low-level purposes. Also, anytime you provide a GdkColormap, the visual is implied as part of the colormap (gdk_colormap_get_visual()), so you won't have to provide a visual in addition.

There are several standard visuals. The visual returned by gdk_visual_get_system() is the system's default visual. gdk_rgb_get_visual() return the visual most suited to displaying full-color image data. If you use the calls in GdkRGB, you should create your windows using this visual (and the colormap returned by gdk_rgb_get_colormap()).

A number of functions are provided for determining the "best" available visual. For the purposes of making this determination, higher bit depths are considered better, and for visuals of the same bit depth, GDK_VISUAL_PSEUDO_COLOR is preferred at 8bpp, otherwise, the visual types are ranked in the order of (highest to lowest) GDK_VISUAL_DIRECT_COLOR, GDK_VISUAL_TRUE_COLOR, GDK_VISUAL_PSEUDO_COLOR, GDK_VISUAL_STATIC_COLOR, GDK_VISUAL_GRAYSCALE, then GDK_VISUAL_STATIC_GRAY.

Details


Pixmaps:
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).
阅读(382) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~