gdk-sharp0.0.0.0neutralGtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.Represents a graphics context
The Gdk.GC class is used to represent a graphics context.
A number of resources are used when performing graphics
operations. Most information about performing graphics (for
example, foreground color, background color, line style, and
so on) is stored in resources called graphics contexts
(GCs). Most graphics operations take a GC as an
argument.
Graphics operations can be performed to either windows () or pixmaps (), which collectively are called
drawables (). Each drawable exists
on a single screen. A GC is created for a specific screen and
drawable depth and can only be used with drawables of matching
screen and depth.
GLib.ObjectGLib.IWrapperSystem.IDisposableMethodSystem.VoidCopy the set of values from one graphics context onto another graphics context.
The GC to copy.
Copies the settings of the graphics
context into this GC.
MethodSystem.VoidSet the origin when using tiles or stipples with the GC.
the x-coordinate of the origin.
the y-coordinate of the origin.
Set the origin when using tiles or stipples with the
GC. The tile or stipple will be aligned such that the upper
left corner of the tile or stipple will coincide with this
point.
MethodSystem.VoidSets the origin of the clip mask.
the x-coordinate of the origin.
the y-coordinate of the origin.
Sets the origin of the clip mask. The coordinates are
interpreted relative to the upper-left corner of the
destination drawable of the current operation.MethodSystem.VoidSet the x and y offsets on the Gdk.GC
amount by which to offset the GC in the X direction
amount by which to offset the GC in the Y direction
Offset attributes such as the clip and tile-stipple
origins of the GC so that drawing at x - x_offset, y -
y_offset with the offset GC has the same effect as drawing
at x, y with the original GC.MethodSystem.VoidSets attributes of a graphics context in bulk.
struct containing the new values
mask indicating which struct fields are to be used
Sets attributes of a graphics context in bulk. For
each flag set in values_mask, the corresponding field will
be read from values and set as the new value for gc. If
you're only setting a few values on gc, calling individual
"setter" functions is likely more convenient.MethodSystem.VoidSets various attributes of how lines are drawn.
the width of lines.
the dash-style for lines.
the manner in which the ends of lines are drawn.
the way in which lines are joined together.
Sets various attributes of how lines are drawn. See
the corresponding members of Gdk.GC.Values for full
explanations of the arguments.MethodSystem.VoidRetrieves the current values from a graphics context.
the GdkGCValues structure in which to store the results.
Retrieves the current values from a graphics context.MethodSystem.VoidDisposes the resources associated with the object.ConstructorInternal constructor
Pointer to the C object.
An instance of GC, wrapping the C object.This is an internal constructor, and should not be used by user code.ConstructorTo be added
To be added: an object of type 'Gdk.Drawable'
To be added: an object of type 'Gdk.GC'To be addedConstructorTo be added
To be added: an object of type 'Gdk.Drawable'
To be added: an object of type 'Gdk.GCValues'
To be added: an object of type 'Gdk.GCValuesMask'
To be added: an object of type 'Gdk.GC'To be addedConstructorTo be addedTo be added: an object of type 'Gdk.GC'To be addedPropertySystem.UInt32The GLib Type for Gdk.GCThe GLib Type for the Gdk.GC class.PropertyGdk.ColorSet the foreground color of a GC using an unallocated color.an object of type 'Gdk.Color'Set the foreground color of a GC using an unallocated
color. The pixel value for the color will be determined
using GdkRGB. If the colormap for the GC has not previously
been initialized for GdkRGB, then for pseudo-color colormaps
(colormaps with a small modifiable number of colors), a
colorcube will be allocated in the colormap.Calling this function for a GC without a colormap is
an error.PropertyGdk.RectangleSets the clip mask for a graphics context from a rectangle.
the rectangle to clip to.
an object of type 'Gdk.Rectangle'Sets the clip mask for a graphics context from a
rectangle. The clip mask is interpreted relative to the clip
origin. (See ).PropertyGdk.PixmapSet a tile pixmap for a graphics context.
the new tile pixmap.
an object of type 'Gdk.Pixmap'Set a tile pixmap for a graphics context. This will
only be used if the fill mode is GDK_TILED.PropertyGdk.BitmapSets the clip mask for a graphics context from a bitmap.
a bitmap.
a bitmap.Sets the clip mask for a graphics context from a
bitmap. The clip mask is interpreted relative to the clip
origin. (See ).PropertyGdk.FillSet the fill mode for a graphics context.
the new fill mode.
the new fill mode.Set the fill mode for a graphics context.PropertyGdk.ColormapSets the colormap for the GC to the given colormap.
a Gdk.Colormap
a Gdk.Colormap
Fetches or changes the colormap of the GC. The depth of
the colormap's visual must match the depth of the drawable
for which the GC was created.
PropertyGdk.ColorSet the background color of a GC using an unallocated color.
a Gdk.Color
a Gdk.ColorSet the background color of a GC using an unallocated
color. The pixel value for the color will be determined
using GdkRGB. If the colormap for the GC has not previously
been initialized for GdkRGB, then for pseudo-color colormaps
(colormaps with a small modifiable number of colors), a
colorcube will be allocated in the colormap.Calling this function for a GC without a colormap is
an error.PropertyGdk.ColorSets the foreground color for a graphics context.
the new foreground color.
the new foreground color.
Sets the foreground color for a graphics context to the
given color. The color must have been allocated for this
to work.
Gdk.GC my_gc = new Gdk.GC (gdk_window);
//
// Create the color
//
Gdk.Color red_color = new Gdk.Color (0xff, 0, 0);
//
// Allocate it
//
Gdk.Colormap colormap = Gdk.Colormap.System;
colormap.AllocColor (ref red_color, true, true);
my_gc.Foreground = red_color;
//
// Draw diagonal, using the GC with the red color
//
gdk_window.DrawLine (my_gc, 0, 0, 100, 100);
PropertyGdk.RegionSets the clip mask for a graphics context from a region structure.
the Gdk.Region
the Gdk.RegionSets the clip mask for a graphics context from a
region structure. The clip mask is interpreted relative to
the clip origin. (See ).PropertyGdk.SubwindowModeSets how drawing with this GC on a window will affect child windows of that window.
the subwindow mode.
the subwindow mode.Sets how drawing with this GC on a window will affect
child windows of that window.PropertyGdk.PixmapSet the stipple bitmap for a graphics context.
the new stipple bitmap.
the new stipple bitmap.
Set the stipple bitmap for a graphics context. The
stipple will only be used if the fill mode is
or .
PropertyGdk.FunctionDetermines how the current pixel values and the pixel values being drawn are combined to produce the final pixel values.
a function.
a function.Determines how the current pixel values and the pixel
values being drawn are combined to produce the final pixel
values.PropertyGdk.ColorSets the background color for a graphics context.
the new background color.
the new background color.
Sets the background color for a graphics
context. The color must have been allocated.
Gdk.GC my_gc = new Gdk.GC (gdk_window);
//
// Create the color
//
Gdk.Color back_color = new Gdk.Color (0xff, 0, 0);
Gdk.Color fore_color = new Gdk.Color (0, 0, 0xff);
//
// Allocate them
//
Gdk.Colormap colormap = Gdk.Colormap.System;
colormap.AllocColor (ref back_color, true, true);
Gdk.Colormap colormap = Gdk.Colormap.System;
colormap.AllocColor (ref fore_color, true, true);
my_gc.Background = back_color;
my_gc.Background = fore_color;
//
// Draw a thick line, alternating between foreground and
// background colors
//
my_gc.SetLineAttributes (3, LineStyle.DoubleDash, CapStyle.NotLast, JoinStyle.Round);
//
// Draw diagonal, using the GC with the red color
//
gdk_window.DrawLine (my_gc, 0, 0, 100, 100);
PropertySystem.BooleanSets whether or not this GC should geenrate exposure events.
To be added: an object of type 'bool'
To be added: an object of type 'bool'Sets whether copying non-visible portions of a
drawable using this graphics context generate exposure
events for the corresponding regions of the destination
drawable. (See ).ConstructorInternal constructor
GLib type for the type
Creates a new instance of GC, using the GLib-provided typeThis is a constructor used by derivative types of that would have their own GLib type assigned to it. This is not typically used by C# code.PropertyGdk.ScreenTo be addeda To be addedMethodSystem.VoidSets the way dashed-lines are drawn.
the dash offset.
an array of dash lengths.
the number of elemenst in dash_list.
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.SetLineAttributes())