Class: Wx::DC
- Inherits:
-
ReadOnlyDC
- Object
- Object
- ReadOnlyDC
- Wx::DC
- Defined in:
- lib/wx/doc/gen/dc.rb,
lib/wx/doc/dc.rb
Overview
This class is untracked and should not be derived from nor instances extended!
A DC is a “device context” onto which graphics and text can be drawn.
It is intended to represent different output devices and offers a common abstract API for drawing on any of them. DC also provides functions for coordinate transformation and computing text metrics and extends that are inherited from its base class ReadOnlyDC. wxWidgets offers an alternative drawing API based on the modern drawing backends GDI+, CoreGraphics, Cairo and Direct2D. See GraphicsContext, GraphicsRenderer and related classes. There is also a GCDC linking the APIs by offering the DC API on top of a GraphicsContext. DC is an abstract base class and cannot be created directly. Use PaintDC for drawing on screen, MemoryDC for off-screen drawing or PRT::PrinterDC for printing (the remaining drawing contexts ClientDC, WindowDC and ScreenDC are deprecated and don’t work on all platforms any longer). Notice that PaintDC uses the window font and colours by default (starting with wxWidgets 2.9.0) but the other device context classes use system-default values so you always must set the appropriate fonts and colours before using them. In addition to the classes listed above, you can use InfoDC which can only provide information about the device context but not draw on it. This class is useful when you need a device context associated with a window outside of the paint event handler, i.e. when PaintDC can’t be used. In addition to the versions of the methods documented below, there are also versions which accept single Point parameter instead of the two Coord ones or Point and Size instead of the four Coord parameters. Beginning with wxWidgets 2.9.0 the entire DC code has been reorganized. All platform dependent code (actually all drawing code) has been moved into backend classes which derive from a common DCImpl class. The user-visible classes such as ClientDC and PaintDC merely forward all calls to the backend implementation. In wxWidgets 3.3.0 the new ReadOnlyDC class was extracted from DC: it contains all the functions that don’t actually draw on the device context, but just return information about it. This class should be rarely used directly, but some function that used to take DC argument but didn’t need to modify it, now accept ReadOnlyDC instead to make this fact explicit, and such functions can now also be called with InfoDC objects as arguments.
Device and logical units
In the DC context there is a distinction between logical units and device units. Device units are the units native to the particular device; e.g. for a screen, a device unit is a pixel. For a printer, the device unit is defined by the resolution of the printer (usually given in DPI: dot-per-inch). All DC functions use instead logical units, unless where explicitly stated. Logical units are arbitrary units mapped to device units using the current mapping mode (see SetMapMode). This mechanism allows reusing the same code which prints on e.g. a window on the screen to print on e.g. a paper.
Support for Transparency / Alpha Channel
In general DC methods don’t support alpha transparency and the alpha component of Colour is simply ignored and you need to use GraphicsContext for full transparency support. There are, however, a few exceptions: first, under macOS and GTK+ 3 colours with alpha channel are supported in all the normal DC-derived classes as they use GraphicsContext internally. Second, under all platforms SVGFileDC also fully supports alpha channel. In both of these cases the instances of Pen or Brush that are built from Colour use the colour’s alpha values when stroking or filling.
Support for Transformation Matrix
On some platforms (currently under MSW, GTK+ 3, macOS) DC has support for applying an arbitrary affine transformation matrix to its coordinate system (since 3.1.1 this feature is also supported by GCDC in all ports). Call ReadOnlyDC#can_use_transform_matrix to check if this support is available and then call ReadOnlyDC#set_transform_matrix if it is. If the transformation matrix is not supported, ReadOnlyDC#set_transform_matrix always simply returns false and doesn’t do anything. This feature is only available when Setup::USE_DC_TRANSFORM_MATRIX build option is enabled.
Category: Device Contexts, Graphics Device Interface (GDI)
TodoPrecise definition of default/initial state. Pixelwise definition of operations (e.g. last point of a line not drawn).
Direct Known Subclasses
GCDC, MemoryDC, MirrorDC, OverlayDC, PRT::PostScriptDC, PRT::PrinterDC, SVGFileDC, ScaledDC, ScreenDC, WindowDC
Instance Method Summary collapse
-
#blit(xdest, ydest, width, height, source, xsrc, ysrc, logicalFunc = Wx::RasterOperationMode::COPY, useMask = false, xsrcMask = Wx::DEFAULT_COORD, ysrcMask = Wx::DEFAULT_COORD) ⇒ Boolean
Copy from a source DC to this DC.
- #calc_bounding_box(x, y) ⇒ void
-
#clear ⇒ void
Clears the device context using the current background brush.
-
#copy_attributes(dc) ⇒ void
Copy attributes from another DC.
- #cross_hair(*args) ⇒ Object
-
#destroy_clipping_region ⇒ void
Destroys the current clipping region so that none of the DC is clipped.
- #draw_arc(*args) ⇒ Object
- #draw_bitmap(*args) ⇒ Object
- #draw_check_mark(*args) ⇒ Object
- #draw_circle(*args) ⇒ Object
- #draw_ellipse(*args) ⇒ Object
- #draw_elliptic_arc(*args) ⇒ Object
- #draw_icon(*args) ⇒ Object
- #draw_label(*args) ⇒ Object
- #draw_line(*args) ⇒ Object
-
#draw_lines(points, xoffset = 0, yoffset = 0) ⇒ void
Draws lines using an array of points of size n adding the optional offset coordinate.
- #draw_point(*args) ⇒ Object
-
#draw_poly_polygon(points, xoffset = 0, yoffset = 0, fill_style = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ void
Draws two or more filled polygons using an array of points, adding the optional offset coordinates.
-
#draw_polygon(points, xoffset = 0, yoffset = 0, fill_style = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ void
Draws a filled polygon using an array of points of size n, adding the optional offset coordinate.
- #draw_rectangle(*args) ⇒ Object
- #draw_rotated_text(*args) ⇒ Object
- #draw_rounded_rectangle(*args) ⇒ Object
- #draw_spline(*args) ⇒ Object
- #draw_text(*args) ⇒ Object
-
#end_doc ⇒ void
Ends a document (only relevant when outputting to a printer).
-
#end_page ⇒ void
Ends a document page (only relevant when outputting to a printer).
- #flood_fill(*args) ⇒ Object
-
#get_as_bitmap(subrect = nil) ⇒ Wx::Bitmap
(also: #as_bitmap)
If supported by the platform and the type of DC, fetch the contents of the DC, or a subset of it, as a bitmap.
-
#get_background ⇒ Wx::Brush
(also: #background)
Gets the brush used for painting the background.
-
#get_background_mode ⇒ Integer
(also: #background_mode)
Returns the current background mode: BrushStyle::BRUSHSTYLE_SOLID or BrushStyle::BRUSHSTYLE_TRANSPARENT.
-
#get_brush ⇒ Wx::Brush
(also: #brush)
Gets the current brush.
- #get_clipping_box(*args) ⇒ Object (also: #clipping_box)
-
#get_graphics_context ⇒ Wx::GraphicsContext
(also: #graphics_context)
If supported by the platform and the DC implementation, this method will return the GraphicsContext associated with the DC.
-
#get_logical_function ⇒ Wx::RasterOperationMode
(also: #logical_function)
Gets the current logical function.
-
#get_pen ⇒ Wx::Pen
(also: #pen)
Gets the current pen.
-
#get_pixel(x, y, colour) ⇒ Boolean
(also: #pixel)
Gets in colour the colour at the specified location.
-
#get_text_background ⇒ Wx::Colour, ...
(also: #text_background)
Gets the current text background colour.
-
#get_text_foreground ⇒ Wx::Colour, ...
(also: #text_foreground)
Gets the current text foreground colour.
- #gradient_fill_concentric(*args) ⇒ Object
-
#gradient_fill_linear(rect, initialColour, destColour, nDirection = Wx::Direction::RIGHT) ⇒ void
Fill the area specified by rect with a linear gradient, starting from initialColour and eventually fading to destColour.
-
#max_x ⇒ Integer
Gets the maximum horizontal extent used in drawing commands so far.
-
#max_y ⇒ Integer
Gets the maximum vertical extent used in drawing commands so far.
-
#min_x ⇒ Integer
Gets the minimum horizontal extent used in drawing commands so far.
-
#min_y ⇒ Integer
Gets the minimum vertical extent used in drawing commands so far.
-
#reset_bounding_box ⇒ void
Resets the bounding box: after a call to this function, the bounding box doesn’t contain anything.
-
#set_background(brush) ⇒ void
(also: #background=)
Sets the current background brush for the DC.
-
#set_background_mode(mode) ⇒ void
(also: #background_mode=)
Change the current background mode.
-
#set_brush(brush) ⇒ void
(also: #brush=)
Sets the current brush for the DC.
- #set_clipping_region(*args) ⇒ Object (also: #clipping_region=)
-
#set_device_clipping_region(region) ⇒ void
(also: #device_clipping_region=)
Sets the clipping region for this device context.
-
#set_graphics_context(ctx) ⇒ void
(also: #graphics_context=)
Associate a GraphicsContext with the DC.
-
#set_logical_function(function) ⇒ void
(also: #logical_function=)
Sets the current logical function for the device context.
-
#set_palette(palette) ⇒ void
(also: #palette=)
If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC.
-
#set_pen(pen) ⇒ void
(also: #pen=)
Sets the current pen for the DC.
-
#set_text_background(colour) ⇒ void
(also: #text_background=)
Sets the current text background colour for the DC.
-
#set_text_foreground(colour) ⇒ void
(also: #text_foreground=)
Sets the current text foreground colour for the DC.
-
#start_doc(message) ⇒ Boolean
Starts a document (only relevant when outputting to a printer).
-
#start_page ⇒ void
Starts a document page (only relevant when outputting to a printer).
-
#stretch_blit(xdest, ydest, dstWidth, dstHeight, source, xsrc, ysrc, srcWidth, srcHeight, logicalFunc = Wx::RasterOperationMode::COPY, useMask = false, xsrcMask = Wx::DEFAULT_COORD, ysrcMask = Wx::DEFAULT_COORD) ⇒ Boolean
Copy from a source DC to this DC possibly changing the scale.
-
#with_background_mode(mode) {|dc| ... } ⇒ void
(also: #with_bg_mode)
Provides similar functionality like wxDCTextBgModeChanger setting the given mode as the active background mode for the DC for the duration of the block execution restoring the previous mode afterwards.
-
#with_brush(brush) {|dc| ... } ⇒ void
Provides similar functionality like wxDCBrushChanger setting the given brush as the active brush for the DC for the duration of the block execution restoring the previous brush afterwards.
-
#with_font(font) {|dc| ... } ⇒ void
Provides similar functionality like wxDCFontChanger setting the given font as the active font for the DC for the duration of the block execution restoring the previous font afterwards.
-
#with_pen(pen) {|dc| ... } ⇒ void
Provides similar functionality like wxDCPenChanger setting the given pen as the active pen for the DC for the duration of the block execution restoring the previous pen afterwards.
-
#with_text_background(clr) {|dc| ... } ⇒ void
(also: #with_text_bg)
Provides similar functionality like wxDCTextBgColourChanger setting the given colour as the active text background colour for the DC for the duration of the block execution restoring the previous colour afterwards.
-
#with_text_foreground(clr) {|dc| ... } ⇒ void
(also: #with_text_fg)
Provides similar functionality like wxDCTextColourChanger setting the given colour as the active text foreground colour for the DC for the duration of the block execution restoring the previous colour afterwards.
Methods inherited from ReadOnlyDC
#can_draw_bitmap, #can_get_text_extent, #can_use_transform_matrix, #device_to_logical, #device_to_logical_rel, #device_to_logical_x, #device_to_logical_x_rel, #device_to_logical_y, #device_to_logical_y_rel, #from_dip, #get_char_height, #get_char_width, #get_content_scale_factor, #get_depth, #get_device_origin, #get_dimensions, #get_dimensions_mm, #get_font, #get_font_metrics, #get_layout_direction, #get_logical_origin, #get_logical_scale, #get_map_mode, #get_multi_line_text_extent, #get_multi_line_text_size, #get_ppi, #get_size, #get_size_mm, #get_text_extent, #get_text_size, #get_transform_matrix, #get_user_scale, #is_ok, #logical_to_device, #logical_to_device_rel, #logical_to_device_x, #logical_to_device_x_rel, #logical_to_device_y, #logical_to_device_y_rel, #reset_transform_matrix, #set_axis_orientation, #set_device_origin, #set_font, #set_layout_direction, #set_logical_origin, #set_logical_scale, #set_map_mode, #set_transform_matrix, #set_user_scale, #to_dip
Methods inherited from Object
#clone, #dup, #initialize, #is_same_as, #un_share
Constructor Details
This class inherits a constructor from Wx::Object
Instance Method Details
#blit(xdest, ydest, width, height, source, xsrc, ysrc, logicalFunc = Wx::RasterOperationMode::COPY, useMask = false, xsrcMask = Wx::DEFAULT_COORD, ysrcMask = Wx::DEFAULT_COORD) ⇒ Boolean
Copy from a source DC to this DC.
With this method you can specify the destination coordinates and the size of area to copy which will be the same for both the source and target DCs. If you need to apply scaling while copying, use #stretch_blit. Notice that source DC coordinates xsrc and ysrc are interpreted using the current source DC coordinate system, i.e. the scale, origin position and axis directions are taken into account when transforming them to physical (pixel) coordinates.
There is partial support for #blit in PRT::PostScriptDC, under X.
1317 |
# File 'lib/wx/doc/gen/dc.rb', line 1317 def blit(xdest, ydest, width, height, source, xsrc, ysrc, logicalFunc=Wx::RasterOperationMode::COPY, useMask=false, xsrcMask=Wx::DEFAULT_COORD, ysrcMask=Wx::DEFAULT_COORD) end |
#calc_bounding_box(x, y) ⇒ void
1225 |
# File 'lib/wx/doc/gen/dc.rb', line 1225 def calc_bounding_box(x, y) end |
#clear ⇒ void
This method returns an undefined value.
Clears the device context using the current background brush.
Note that #set_background method must be used to set the brush used by #clear, the brush used for filling the shapes set by #set_brush is ignored by it. If no background brush was set, solid white brush is used to clear the device context.
675 |
# File 'lib/wx/doc/gen/dc.rb', line 675 def clear; end |
#copy_attributes(dc) ⇒ void
This method returns an undefined value.
Copy attributes from another DC.
The copied attributes currently are:
-
Font
-
Text foreground and background colours
-
Background brush
-
Layout direction
Note that the scaling factor is not considered to be an attribute of Wx::DC and is not copied by this function.
1484 |
# File 'lib/wx/doc/gen/dc.rb', line 1484 def copy_attributes(dc) end |
#cross_hair(x, y) ⇒ void #cross_hair(pt) ⇒ void
1096 |
# File 'lib/wx/doc/gen/dc.rb', line 1096 def cross_hair(*args) end |
#destroy_clipping_region ⇒ void
This method returns an undefined value.
Destroys the current clipping region so that none of the DC is clipped.
1103 |
# File 'lib/wx/doc/gen/dc.rb', line 1103 def destroy_clipping_region; end |
#draw_arc(xStart, yStart, xEnd, yEnd, xc, yc) ⇒ void #draw_arc(ptStart, ptEnd, centre) ⇒ void
702 |
# File 'lib/wx/doc/gen/dc.rb', line 702 def draw_arc(*args) end |
#draw_bitmap(bitmap, x, y, useMask = false) ⇒ void #draw_bitmap(bmp, pt, useMask = false) ⇒ void
723 |
# File 'lib/wx/doc/gen/dc.rb', line 723 def draw_bitmap(*args) end |
#draw_check_mark(x, y, width, height) ⇒ void #draw_check_mark(rect) ⇒ void
736 |
# File 'lib/wx/doc/gen/dc.rb', line 736 def draw_check_mark(*args) end |
#draw_circle(x, y, radius) ⇒ void #draw_circle(pt, radius) ⇒ void
752 |
# File 'lib/wx/doc/gen/dc.rb', line 752 def draw_circle(*args) end |
#draw_ellipse(x, y, width, height) ⇒ void #draw_ellipse(pt, size) ⇒ void #draw_ellipse(rect) ⇒ void
773 |
# File 'lib/wx/doc/gen/dc.rb', line 773 def draw_ellipse(*args) end |
#draw_elliptic_arc(x, y, width, height, start, end_) ⇒ void #draw_elliptic_arc(pt, sz, sa, ea) ⇒ void
798 |
# File 'lib/wx/doc/gen/dc.rb', line 798 def draw_elliptic_arc(*args) end |
#draw_icon(icon, x, y) ⇒ void #draw_icon(icon, pt) ⇒ void
813 |
# File 'lib/wx/doc/gen/dc.rb', line 813 def draw_icon(*args) end |
#draw_label(text, bitmap, rect, alignment = (Wx::Alignment::ALIGN_LEFT|Wx::Alignment::ALIGN_TOP), indexAccel = -1, rectBounding = nil) ⇒ void #draw_label(text, rect, alignment = (Wx::Alignment::ALIGN_LEFT|Wx::Alignment::ALIGN_TOP), indexAccel = -1) ⇒ void
831 |
# File 'lib/wx/doc/gen/dc.rb', line 831 def draw_label(*args) end |
#draw_line(x1, y1, x2, y2) ⇒ void #draw_line(pt1, pt2) ⇒ void
847 |
# File 'lib/wx/doc/gen/dc.rb', line 847 def draw_line(*args) end |
#draw_lines(points, xoffset = 0, yoffset = 0) ⇒ void
This method returns an undefined value.
Draws lines using an array of points of size n adding the optional offset coordinate.
The current pen is used for drawing the lines.
856 |
# File 'lib/wx/doc/gen/dc.rb', line 856 def draw_lines(points, xoffset=0, yoffset=0) end |
#draw_point(x, y) ⇒ void #draw_point(pt) ⇒ void
869 |
# File 'lib/wx/doc/gen/dc.rb', line 869 def draw_point(*args) end |
#draw_poly_polygon(points, xoffset = 0, yoffset = 0, fill_style = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ void
This method returns an undefined value.
Draws two or more filled polygons using an array of points, adding the optional offset coordinates.
Notice that for the platforms providing a native implementation of this function (Windows and PostScript-based Wx::DC currently), this is more efficient than using #draw_polygon in a loop. n specifies the number of polygons to draw, the array count of size n specifies the number of points in each of the polygons in the points array. The last argument specifies the fill rule: PolygonFillMode::ODDEVEN_RULE (the default) or PolygonFillMode::WINDING_RULE. The current pen is used for drawing the outline, and the current brush for filling the shape. Using a transparent brush suppresses filling. The polygons maybe disjoint or overlapping. Each polygon specified in a call to #draw_poly_polygon must be closed. Unlike polygons created by the #draw_polygon member function, the polygons created by this method are not closed automatically.
895 |
# File 'lib/wx/doc/gen/dc.rb', line 895 def draw_poly_polygon(points, xoffset=0, yoffset=0, fill_style=Wx::PolygonFillMode::ODDEVEN_RULE) end |
#draw_polygon(points, xoffset = 0, yoffset = 0, fill_style = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ void
This method returns an undefined value.
Draws a filled polygon using an array of points of size n, adding the optional offset coordinate.
The first and last points are automatically closed. The last argument specifies the fill rule: PolygonFillMode::ODDEVEN_RULE (the default) or PolygonFillMode::WINDING_RULE. The current pen is used for drawing the outline, and the current brush for filling the shape. Using a transparent brush suppresses filling.
881 |
# File 'lib/wx/doc/gen/dc.rb', line 881 def draw_polygon(points, xoffset=0, yoffset=0, fill_style=Wx::PolygonFillMode::ODDEVEN_RULE) end |
#draw_rectangle(x, y, width, height) ⇒ void #draw_rectangle(pt, sz) ⇒ void #draw_rectangle(rect) ⇒ void
916 |
# File 'lib/wx/doc/gen/dc.rb', line 916 def draw_rectangle(*args) end |
#draw_rotated_text(text, x, y, angle) ⇒ void #draw_rotated_text(text, point, angle) ⇒ void
940 |
# File 'lib/wx/doc/gen/dc.rb', line 940 def draw_rotated_text(*args) end |
#draw_rounded_rectangle(x, y, width, height, radius) ⇒ void #draw_rounded_rectangle(pt, sz, radius) ⇒ void #draw_rounded_rectangle(rect, radius) ⇒ void
964 |
# File 'lib/wx/doc/gen/dc.rb', line 964 def draw_rounded_rectangle(*args) end |
#draw_spline(points) ⇒ void #draw_spline(x1, y1, x2, y2, x3, y3) ⇒ void
987 |
# File 'lib/wx/doc/gen/dc.rb', line 987 def draw_spline(*args) end |
#draw_text(text, x, y) ⇒ void #draw_text(text, pt) ⇒ void
1009 |
# File 'lib/wx/doc/gen/dc.rb', line 1009 def draw_text(*args) end |
#end_doc ⇒ void
This method returns an undefined value.
Ends a document (only relevant when outputting to a printer).
1263 |
# File 'lib/wx/doc/gen/dc.rb', line 1263 def end_doc; end |
#end_page ⇒ void
This method returns an undefined value.
Ends a document page (only relevant when outputting to a printer).
1267 |
# File 'lib/wx/doc/gen/dc.rb', line 1267 def end_page; end |
#flood_fill(x, y, colour, style = Wx::FloodFillStyle::FLOOD_SURFACE) ⇒ Boolean #flood_fill(pt, col, style = Wx::FloodFillStyle::FLOOD_SURFACE) ⇒ Boolean
1083 |
# File 'lib/wx/doc/gen/dc.rb', line 1083 def flood_fill(*args) end |
#get_as_bitmap(subrect = nil) ⇒ Wx::Bitmap Also known as: as_bitmap
If supported by the platform and the type of DC, fetch the contents of the DC, or a subset of it, as a bitmap.
1489 |
# File 'lib/wx/doc/gen/dc.rb', line 1489 def get_as_bitmap(subrect=nil) end |
#get_background ⇒ Wx::Brush Also known as: background
Gets the brush used for painting the background.
1373 |
# File 'lib/wx/doc/gen/dc.rb', line 1373 def get_background; end |
#get_background_mode ⇒ Integer Also known as: background_mode
Returns the current background mode: BrushStyle::BRUSHSTYLE_SOLID or BrushStyle::BRUSHSTYLE_TRANSPARENT.
1175 |
# File 'lib/wx/doc/gen/dc.rb', line 1175 def get_background_mode; end |
#get_brush ⇒ Wx::Brush Also known as: brush
Gets the current brush.
1381 |
# File 'lib/wx/doc/gen/dc.rb', line 1381 def get_brush; end |
#get_clipping_box(x, y) ⇒ Array(Boolean,Integer,Integer) #get_clipping_box(rect) ⇒ Boolean Also known as: clipping_box
1124 |
# File 'lib/wx/doc/gen/dc.rb', line 1124 def get_clipping_box(*args) end |
#get_graphics_context ⇒ Wx::GraphicsContext Also known as: graphics_context
If supported by the platform and the Wx::DC implementation, this method will return the GraphicsContext associated with the DC.
Otherwise nil is returned.
1496 |
# File 'lib/wx/doc/gen/dc.rb', line 1496 def get_graphics_context; end |
#get_logical_function ⇒ Wx::RasterOperationMode Also known as: logical_function
Gets the current logical function.
1422 |
# File 'lib/wx/doc/gen/dc.rb', line 1422 def get_logical_function; end |
#get_pen ⇒ Wx::Pen Also known as: pen
Gets the current pen.
1389 |
# File 'lib/wx/doc/gen/dc.rb', line 1389 def get_pen; end |
#get_pixel(x, y, colour) ⇒ Boolean Also known as: pixel
Gets in colour the colour at the specified location.
This method isn’t available for PRT::PostScriptDC or MetafileDC nor for any DC in WXOSX port and simply returns false there.
Setting a pixel can be done using #draw_point.
This method shouldn't be used with PaintDC as accessing the DC while drawing can result in unexpected results, notably in WXGTK.
1444 |
# File 'lib/wx/doc/gen/dc.rb', line 1444 def get_pixel(x, y, colour) end |
#get_text_background ⇒ Wx::Colour, ... Also known as: text_background
Gets the current text background colour.
1183 |
# File 'lib/wx/doc/gen/dc.rb', line 1183 def get_text_background; end |
#get_text_foreground ⇒ Wx::Colour, ... Also known as: text_foreground
Gets the current text foreground colour.
1191 |
# File 'lib/wx/doc/gen/dc.rb', line 1191 def get_text_foreground; end |
#gradient_fill_concentric(rect, initialColour, destColour) ⇒ void #gradient_fill_concentric(rect, initialColour, destColour, circleCenter) ⇒ void
1040 |
# File 'lib/wx/doc/gen/dc.rb', line 1040 def gradient_fill_concentric(*args) end |
#gradient_fill_linear(rect, initialColour, destColour, nDirection = Wx::Direction::RIGHT) ⇒ void
This method returns an undefined value.
Fill the area specified by rect with a linear gradient, starting from initialColour and eventually fading to destColour.
The nDirection specifies the direction of the colour change, default is to use initialColour on the left part of the rectangle and destColour on the right one.
1050 |
# File 'lib/wx/doc/gen/dc.rb', line 1050 def gradient_fill_linear(rect, initialColour, destColour, nDirection=Wx::Direction::RIGHT) end |
#max_x ⇒ Integer
Gets the maximum horizontal extent used in drawing commands so far.
1229 |
# File 'lib/wx/doc/gen/dc.rb', line 1229 def max_x; end |
#max_y ⇒ Integer
Gets the maximum vertical extent used in drawing commands so far.
1233 |
# File 'lib/wx/doc/gen/dc.rb', line 1233 def max_y; end |
#min_x ⇒ Integer
Gets the minimum horizontal extent used in drawing commands so far.
1237 |
# File 'lib/wx/doc/gen/dc.rb', line 1237 def min_x; end |
#min_y ⇒ Integer
Gets the minimum vertical extent used in drawing commands so far.
1241 |
# File 'lib/wx/doc/gen/dc.rb', line 1241 def min_y; end |
#reset_bounding_box ⇒ void
This method returns an undefined value.
Resets the bounding box: after a call to this function, the bounding box doesn’t contain anything.
1248 |
# File 'lib/wx/doc/gen/dc.rb', line 1248 def reset_bounding_box; end |
#set_background(brush) ⇒ void Also known as: background=
This method returns an undefined value.
Sets the current background brush for the DC.
1395 |
# File 'lib/wx/doc/gen/dc.rb', line 1395 def set_background(brush) end |
#set_background_mode(mode) ⇒ void Also known as: background_mode=
This method returns an undefined value.
Change the current background mode.
This setting determines whether text will be drawn with a background colour or not. Default is BrushStyle::BRUSHSTYLE_TRANSPARENT, i.e. text background is not drawn.
1200 |
# File 'lib/wx/doc/gen/dc.rb', line 1200 def set_background_mode(mode) end |
#set_brush(brush) ⇒ void Also known as: brush=
This method returns an undefined value.
Sets the current brush for the DC.
If the argument is NULL_BRUSH (or another invalid brush; see Brush#is_ok), the current brush is selected out of the device context (leaving Wx::DC without any valid brush), allowing the current brush to be destroyed safely.
1405 |
# File 'lib/wx/doc/gen/dc.rb', line 1405 def set_brush(brush) end |
#set_clipping_region(x, y, width, height) ⇒ void #set_clipping_region(pt, sz) ⇒ void #set_clipping_region(rect) ⇒ void Also known as: clipping_region=
1159 |
# File 'lib/wx/doc/gen/dc.rb', line 1159 def set_clipping_region(*args) end |
#set_device_clipping_region(region) ⇒ void Also known as: device_clipping_region=
This method returns an undefined value.
Sets the clipping region for this device context.
Unlike #set_clipping_region, this function works with physical coordinates and not with the logical ones.
1167 |
# File 'lib/wx/doc/gen/dc.rb', line 1167 def set_device_clipping_region(region) end |
#set_graphics_context(ctx) ⇒ void Also known as: graphics_context=
This method returns an undefined value.
Associate a GraphicsContext with the DC.
Ignored if not supported by the specific Wx::DC implementation. It is unlikely that this will need to be used in application code.
1504 |
# File 'lib/wx/doc/gen/dc.rb', line 1504 def set_graphics_context(ctx) end |
#set_logical_function(function) ⇒ void Also known as: logical_function=
This method returns an undefined value.
Sets the current logical function for the device context.
This function is not fully supported in all ports, due to the limitations of the underlying drawing model. Notably, RasterOperationMode::INVERT which was commonly used for drawing rubber bands or other moving outlines in the past, is not, and will not, be supported by WXGTK3 and WXOSX. The suggested alternative is to draw temporarily objects normally and refresh the (affected part of the) window to remove them later.
It determines how a source pixel (from a pen or brush colour, or source device context if using #blit) combines with a destination pixel in the current device context. Text drawing is not affected by this function. See RasterOperationMode enumeration values for more info. The default is RasterOperationMode::COPY, which simply draws with the current colour. The others combine the current colour and the background using a logical operation.
1460 |
# File 'lib/wx/doc/gen/dc.rb', line 1460 def set_logical_function(function) end |
#set_palette(palette) ⇒ void Also known as: palette=
This method returns an undefined value.
If this is a window DC or memory DC, assigns the given palette to the window or bitmap associated with the DC.
If the argument is NULL_PALETTE, the current palette is selected out of the device context, and the original palette restored.
1469 |
# File 'lib/wx/doc/gen/dc.rb', line 1469 def set_palette(palette) end |
#set_pen(pen) ⇒ void Also known as: pen=
1414 |
# File 'lib/wx/doc/gen/dc.rb', line 1414 def set_pen(pen) end |
#set_text_background(colour) ⇒ void Also known as: text_background=
This method returns an undefined value.
Sets the current text background colour for the DC.
1206 |
# File 'lib/wx/doc/gen/dc.rb', line 1206 def set_text_background(colour) end |
#set_text_foreground(colour) ⇒ void Also known as: text_foreground=
This method returns an undefined value.
Sets the current text foreground colour for the DC.
1215 |
# File 'lib/wx/doc/gen/dc.rb', line 1215 def set_text_foreground(colour) end |
#start_doc(message) ⇒ Boolean
Starts a document (only relevant when outputting to a printer).
message is a message to show while printing.
1255 |
# File 'lib/wx/doc/gen/dc.rb', line 1255 def start_doc() end |
#start_page ⇒ void
This method returns an undefined value.
Starts a document page (only relevant when outputting to a printer).
1259 |
# File 'lib/wx/doc/gen/dc.rb', line 1259 def start_page; end |
#stretch_blit(xdest, ydest, dstWidth, dstHeight, source, xsrc, ysrc, srcWidth, srcHeight, logicalFunc = Wx::RasterOperationMode::COPY, useMask = false, xsrcMask = Wx::DEFAULT_COORD, ysrcMask = Wx::DEFAULT_COORD) ⇒ Boolean
Copy from a source DC to this DC possibly changing the scale.
Unlike #blit, this method allows specifying different source and destination region sizes, meaning that it can stretch or shrink it while copying. The same can be achieved by changing the scale of the source or target DC but calling this method is simpler and can also be more efficient if the platform provides a native implementation of it. The meaning of its other parameters is the same as with #blit, in particular all source coordinates are interpreted using the source DC coordinate system, i.e. are affected by its scale, origin translation and axis direction.
There is partial support for #blit in PRT::PostScriptDC, under X. See MemoryDC for typical usage.
1366 |
# File 'lib/wx/doc/gen/dc.rb', line 1366 def stretch_blit(xdest, ydest, dstWidth, dstHeight, source, xsrc, ysrc, srcWidth, srcHeight, logicalFunc=Wx::RasterOperationMode::COPY, useMask=false, xsrcMask=Wx::DEFAULT_COORD, ysrcMask=Wx::DEFAULT_COORD) end |
#with_background_mode(mode) {|dc| ... } ⇒ void Also known as: with_bg_mode
This method returns an undefined value.
Provides similar functionality like wxDCTextBgModeChanger setting the given mode as the active background mode for the DC for the duration of the block execution restoring the previous mode afterwards.
53 |
# File 'lib/wx/doc/dc.rb', line 53 def with_background_mode(mode) end |
#with_brush(brush) {|dc| ... } ⇒ void
This method returns an undefined value.
Provides similar functionality like wxDCBrushChanger setting the given brush as the active brush for the DC for the duration of the block execution restoring the previous brush afterwards.
16 |
# File 'lib/wx/doc/dc.rb', line 16 def with_brush(brush) end |
#with_font(font) {|dc| ... } ⇒ void
This method returns an undefined value.
Provides similar functionality like wxDCFontChanger setting the given font as the active font for the DC for the duration of the block execution restoring the previous font afterwards.
30 |
# File 'lib/wx/doc/dc.rb', line 30 def with_font(font) end |
#with_pen(pen) {|dc| ... } ⇒ void
This method returns an undefined value.
Provides similar functionality like wxDCPenChanger setting the given pen as the active pen for the DC for the duration of the block execution restoring the previous pen afterwards.
23 |
# File 'lib/wx/doc/dc.rb', line 23 def with_pen(pen) end |
#with_text_background(clr) {|dc| ... } ⇒ void Also known as: with_text_bg
This method returns an undefined value.
Provides similar functionality like wxDCTextBgColourChanger setting the given colour as the active text background colour for the DC for the duration of the block execution restoring the previous colour afterwards.
45 |
# File 'lib/wx/doc/dc.rb', line 45 def with_text_background(clr) end |
#with_text_foreground(clr) {|dc| ... } ⇒ void Also known as: with_text_fg
This method returns an undefined value.
Provides similar functionality like wxDCTextColourChanger setting the given colour as the active text foreground colour for the DC for the duration of the block execution restoring the previous colour afterwards.
37 |
# File 'lib/wx/doc/dc.rb', line 37 def with_text_foreground(clr) end |