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

GDK Reference Manual

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

  GDK_CAP_BUTT the ends of the lines are drawn squared off and extending to the coordinates of the end point.

  GDK_CAP_ROUND the ends of the lines are drawn as semicircles with the diameter equal to the line width and centered at the end point.

  GDK_CAP_PROJECTING the ends of the lines are drawn squared off and extending half the width of the line beyond the end point.

  enum GdkJoinStyle


typedef enum
{
GDK_JOIN_MITER,
GDK_JOIN_ROUND,
GDK_JOIN_BEVEL
} GdkJoinStyle; 

  Determines how the joins between segments of a polygon are drawn.

  GDK_JOIN_MITER the sides of each line are extended to meet at an angle.

  GDK_JOIN_ROUND the sides of the two lines are joined by a circular arc.

  GDK_JOIN_BEVEL the sides of the two lines are joined by a straight line which makes an equal angle with each line.


gdk_gc_set_dashes ()
voidgdk_gc_set_dashes (GdkGC *gc,gint dash_offset,gchar dash_list[],gint n); 

  Sets the way dashed-lines are drawn. Lines will be drawn with alternating on and off segments of the lengths specified in dash_list. The manner in which the on and off segments are drawn is determined by the line_style value of the GC. (This can be changed with gdk_gc_set_line_attributes)

  gc : a GdkGC.

  dash_offset : the

  dash_list : an array of dash lengths.

  n : the number of elements in dash_list.


gdk_gc_copy ()
voidgdk_gc_copy (GdkGC *dst_gc,GdkGC *src_gc); 

  Copy the set of values from one graphics context onto another graphics context.

  dst_gc : the destination graphics context.

  src_gc : the source graphics context.

  Drawing Primitives

  Name

  Drawing Primitives -- functions for drawing points, lines, arcs, and text.

  Synopsis


#include <gdk/gdk.h>
voidgdk_draw_point(GdkDrawable *drawable,GdkGC *gc,gint x,gint y);
voidgdk_draw_points (GdkDrawable *drawable,GdkGC *gc,
GdkPoint *points,gint npoints);
voidgdk_draw_line (GdkDrawable *drawable,
GdkGC *gc,gint x1,gint y1,gint x2,gint y2);
voidgdk_draw_lines(GdkDrawable *drawable,
GdkGC *gc,GdkPoint *points,gint npoints);
voidgdk_draw_segments (GdkDrawable *drawable,
GdkGC *gc, GdkSegment *segs,gint nsegs);
structGdkSegment;
voidgdk_draw_rectangle(GdkDrawable *drawable,
GdkGC *gc,gint filled,gint x,gint y,gint width,gint height);
voidgdk_draw_arc(GdkDrawable *drawable,
GdkGC *gc,gint filled,gint x,
gint y,gint width,gint height,gint angle1,gint angle2);
voidgdk_draw_polygon(GdkDrawable *drawable,
GdkGC *gc,gint filled,GdkPoint *points,gint npoints);
voidgdk_draw_string (GdkDrawable *drawable,
GdkFont *font,GdkGC *gc,gint x,gint y,const gchar *string);
voidgdk_draw_text (GdkDrawable *drawable,
GdkFont *font,GdkGC *gc,
gint x,gint y,const gchar *text,gint text_length);
voidgdk_draw_text_wc(GdkDrawable *drawable,
GdkFont *font,GdkGC *gc,gint x,gint y,
const GdkWChar *text,gint text_length);
voidgdk_draw_pixmap (GdkDrawable *drawable,
GdkGC *gc,GdkDrawable *src,gint xsrc,gint ysrc,gint xdest,
gint ydest,gint width,gint height);
voidgdk_draw_image(GdkDrawable *drawable,
GdkGC *gc,GdkImage *image,gint xsrc,gint ysrc,
gint xdest,gint ydest,gint width,gint height);

  Description

  These functions provide support for drawing points, lines, arcs and text onto what are called 'drawables'. Drawables, as the name suggests, are things which support drawing onto them, and are either GdkWindow or GdkPixmap objects.

  Many of the drawing operations take a GdkGC argument, which represents a graphics context. This GdkGC contains a number of drawing attributes such as foreground color, background color and line width, and is used to reduce the number of arguments needed for each drawing operation. See the Graphics Contexts section for more information.

  Details


gdk_draw_point ()
voidgdk_draw_point(GdkDrawable *drawable,
GdkGC *gc,gint x,gint y); 

  Draws a point, using the foreground color and other attributes of the GdkGC.

  drawable : a GdkDrawable (a GdkWindow or a GdkPixmap).

  gc : a GdkGC.

  x : the x coordinate of the point.

  y : the y coordinate of the point.



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



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

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章