Description Methods and Functions Hierarchy Detailed Description Structures Convenient Construction Enums and Flags Author(s) References
Objects to encapsulate drawing properties
gdkGCNew(drawable)
gdkGCNewWithValues(object, values)
gdkGCGetScreen(object)
gdkGCSetValues(object, values)
gdkGCGetValues(object)
gdkGCSetForeground(object, color)
gdkGCSetBackground(object, color)
gdkGCSetRgbFgColor(object, color)
gdkGCSetRgbBgColor(object, color)
gdkGCSetFont(object, font)
gdkGCSetFunction(object, fun)
gdkGCSetFill(object, fill)
gdkGCSetTile(object, tile)
gdkGCSetStipple(object, stipple)
gdkGCSetTsOrigin(object, x, y)
gdkGCSetClipOrigin(object, x, y)
gdkGCSetClipMask(object, mask)
gdkGCSetClipRectangle(object, rectangle)
gdkGCSetClipRegion(object, region)
gdkGCSetSubwindow(object, mode)
gdkGCSetExposures(object, exposures)
gdkGCSetLineAttributes(object, line.width, line.style, cap.style, join.style)
gdkGCSetDashes(object, dash.list)
gdkGCCopy(object, src.gc)
gdkGCSetColormap(object, colormap)
gdkGCGetColormap(object)
gdkGCOffset(object, x.offset, y.offset)
gdkGC(drawable)
1 2 |
All drawing operations in GDK take a graphics context (GC) argument. A graphics context encapsulates information about the way things are drawn, such as the foreground color or line width. By using graphics contexts, the number of arguments to each drawing call is greatly reduced, and communication overhead is minimized, since identical arguments do not need to be passed repeatedly.
Most values of a graphics context can be set at
creation time by using gdkGCNewWithValues,
or can be set one-by-one using functions such
as gdkGCSetForeground. A few of the values
in the GC, such as the dash pattern, can only
be set by the latter method.
GdkGCThe GdkGC structure represents a graphics context.
It is an opaque structure with no user-visible
elements.
GdkGCValuesThe GdkGCValues structure holds a set of values used
to create or modify a graphics context.
GdkGCValues is a transparent-type.
foregroundthe foreground color. Note that gdkGCGetValues
only sets the pixel value.
backgroundthe background color. Note that gdkGCGetValues
only sets the pixel value.
fontthe default font.
functionthe bitwise operation used when drawing.
fillthe fill style.
tilethe tile pixmap.
stipplethe stipple bitmap.
clip_maskthe clip mask bitmap.
subwindow_modethe subwindow mode.
ts_x_originthe x origin of the tile or stipple.
ts_y_originthe y origin of the tile or stipple.
clip_x_originthe x origin of the clip mask.
clip_y_originthe y origin of the clip mask.
graphics_exposureswhether graphics exposures are enabled.
line_widththe line width.
line_stylethe way dashed lines are drawn.
cap_stylethe way the ends of lines are drawn.
join_stylethe way joins between lines are drawn.
gdkGC is the equivalent of gdkGCNew.
GdkGCValuesMaskA set of bit flags used to indicate which fields
GdkGCValues structure are set.
foregroundthe foreground is set.
backgroundthe background is set.
fontthe font is set.
functionthe function is set.
fillthe fill is set.
tilethe tile is set.
stipplethe stipple is set.
clip-maskthe clip.mask is set.
subwindowthe subwindow.mode is set.
ts-x-originthe ts.x.origin is set.
ts-y-originthe ts.y.origin is set.
clip-x-originthe clip.x.origin is set.
clip-y-originthe clip.y.origin is set.
exposuresthe graphics.exposures is set.
line-widththe line.width is set.
line-stylethe line.style is set.
cap-stylethe cap.style is set.
join-stylethe join.style is set.
GdkFunctionDetermines how the bit values for the source pixels are combined with
the bit values for destination pixels to produce the final result. The
sixteen values here correspond to the 16 different possible 2x2 truth
tables. Only a couple of these values are usually useful; for colored
images, only GDK_COPY, GDK_XOR and GDK_INVERT are generally
useful. For bitmaps, GDK_AND and GDK_OR are also useful.
copydst = src
invertdst = NOT dst
xordst = src XOR dst
cleardst = 0
anddst = dst AND src
and-reversedst = src AND (NOT dst)
and-invertdst = (NOT src) AND dst
noopdst = dst
ordst = src OR dst
equivdst = (NOT src) XOR dst
or-reversedst = src OR (NOT dst)
copy-invertdst = NOT src
or-invertdst = (NOT src) OR dst
nanddst = (NOT src) OR (NOT dst)
nordst = (NOT src) AND (NOT dst)
setdst = 1
GdkFillDetermines how primitives are drawn.
soliddraw with the foreground color.
tileddraw with a tiled pixmap.
stippleddraw using the stipple bitmap. Pixels corresponding to bits in the stipple bitmap that are set will be drawn in the foreground color; pixels corresponding to bits that are not set will be left untouched.
opaque-stippleddraw using the stipple bitmap. Pixels corresponding to bits in the stipple bitmap that are set will be drawn in the foreground color; pixels corresponding to bits that are not set will be drawn with the background color.
GdkSubwindowModeDetermines how drawing onto a window will affect child windows of that window.
clip-by-childrenonly draw onto the window itself.
include-inferiorsdraw onto the window and child windows.
GdkLineStyleDetermines how lines are drawn.
solidlines are drawn solid.
on-off-dasheven segments are drawn; odd segments are not drawn.
double-dasheven segments are normally. Odd segments are drawn
in the background color if the fill style is GDK_SOLID, or in the background
color masked by the stipple if the fill style is GDK_STIPPLED.
GdkCapStyleDetermines how the end of lines are drawn.
not-lastthe same as GDK_CAP_BUTT for lines of non-zero width.
for zero width lines, the final point on the line will not be drawn.
buttthe ends of the lines are drawn squared off and extending to the coordinates of the end point.
roundthe ends of the lines are drawn as semicircles with the diameter equal to the line width and centered at the end point.
projectingthe ends of the lines are drawn squared off and extending half the width of the line beyond the end point.
GdkJoinStyleDetermines how the joins between segments of a polygon are drawn.
miterthe sides of each line are extended to meet at an angle.
roundthe sides of the two lines are joined by a circular arc.
bevelthe sides of the two lines are joined by a straight line which makes an equal angle with each line.
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gdk2/stable/gdk2-Graphics-Contexts.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.