Class: Wx::DC
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. 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, ClientDC, WindowDC, ScreenDC, MemoryDC or PRT::PrinterDC. Notice that device contexts which are associated with windows (i.e. ClientDC, WindowDC and PaintDC) use 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 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.
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 #set_map_mode). 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 #can_use_transform_matrix to check if this support is available and then call #set_transform_matrix if it is. If the transformation matrix is not supported, #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, 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
-
#can_draw_bitmap ⇒ Boolean
(also: #can_draw_bitmap?)
Does the DC support drawing bitmaps?.
-
#can_get_text_extent ⇒ Boolean
(also: #can_get_text_extent?)
Does the DC support calculating the size required to draw text?.
-
#can_use_transform_matrix ⇒ Boolean
(also: #can_use_transform_matrix?)
Check if the use of transformation matrix is supported by the current system.
-
#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.
- #device_to_logical(*args) ⇒ Object
- #device_to_logical_rel(*args) ⇒ Object
-
#device_to_logical_x(x) ⇒ Integer
Convert device X coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
-
#device_to_logical_x_rel(x) ⇒ Integer
Convert device X coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
-
#device_to_logical_y(y) ⇒ Integer
Converts device Y coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
-
#device_to_logical_y_rel(y) ⇒ Integer
Convert device Y coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
- #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
- #from_dip(*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_char_height ⇒ Integer
(also: #char_height)
Gets the character height of the currently set font.
-
#get_char_width ⇒ Integer
(also: #char_width)
Gets the average character width of the currently set font.
- #get_clipping_box(*args) ⇒ Object (also: #clipping_box)
-
#get_content_scale_factor ⇒ Float
(also: #content_scale_factor)
Returns the factor used for converting logical pixels to physical ones.
-
#get_depth ⇒ Integer
(also: #depth)
Returns the depth (number of bits/pixel) of this DC.
-
#get_device_origin ⇒ Wx::Point
(also: #device_origin)
Returns the current device origin.
-
#get_dimensions ⇒ Array(Integer,Integer)
(also: #dimensions)
Gets the horizontal and vertical extent of this device context in device units.
-
#get_dimensions_mm ⇒ Array(Integer,Integer)
(also: #dimensions_mm)
Returns the horizontal and vertical resolution in millimetres.
-
#get_font ⇒ Wx::Font, Wx::FontInfo
(also: #font)
Gets the current font.
-
#get_font_metrics ⇒ Wx::FontMetrics
(also: #font_metrics)
Returns the various font characteristics.
-
#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_layout_direction ⇒ Wx::LayoutDirection
(also: #layout_direction)
Gets the current layout direction of the device context.
-
#get_logical_function ⇒ Wx::RasterOperationMode
(also: #logical_function)
Gets the current logical function.
-
#get_logical_origin ⇒ Wx::Point
(also: #logical_origin)
Return the coordinates of the logical point (0, 0).
-
#get_logical_scale ⇒ Array(Float,Float)
(also: #logical_scale)
Return the scale set by the last call to #set_logical_scale.
-
#get_map_mode ⇒ Wx::MappingMode
(also: #map_mode)
Gets the current mapping mode for the device context.
-
#get_multi_line_text_extent(string, font = nil) ⇒ Array(Integer,Integer,Integer)
(also: #multi_line_text_extent)
Gets the dimensions of the string using the currently selected font.
-
#get_multi_line_text_size(string) ⇒ Wx::Size
(also: #multi_line_text_size)
Gets the dimensions of the string using the currently selected font.
-
#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_ppi ⇒ Wx::Size
(also: #ppi)
Returns the resolution of the device in pixels per inch.
-
#get_size ⇒ Wx::Size
(also: #size)
This is an overloaded member function, provided for convenience.
-
#get_size_mm ⇒ Wx::Size
(also: #size_mm)
This is an overloaded member function, provided for convenience.
-
#get_text_background ⇒ Wx::Colour, ...
(also: #text_background)
Gets the current text background colour.
-
#get_text_extent(string, font = nil) ⇒ Array(Integer,Integer,Integer,Integer)
(also: #text_extent)
Gets the dimensions of the string using the currently selected font.
-
#get_text_foreground ⇒ Wx::Colour, ...
(also: #text_foreground)
Gets the current text foreground colour.
-
#get_text_size(string) ⇒ Wx::Size
(also: #text_size)
This is an overloaded member function, provided for convenience.
-
#get_transform_matrix ⇒ Wx::AffineMatrix2D
(also: #transform_matrix)
Return the transformation matrix used by this device context.
-
#get_user_scale ⇒ Array(Float,Float)
(also: #user_scale)
Gets the current user scale factor.
- #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.
-
#is_ok ⇒ Boolean
(also: #ok?)
Returns true if the DC is ok to use.
- #logical_to_device(*args) ⇒ Object
- #logical_to_device_rel(*args) ⇒ Object
-
#logical_to_device_x(x) ⇒ Integer
Converts logical X coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
-
#logical_to_device_x_rel(x) ⇒ Integer
Converts logical X coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
-
#logical_to_device_y(y) ⇒ Integer
Converts logical Y coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
-
#logical_to_device_y_rel(y) ⇒ Integer
Converts logical Y coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
-
#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.
-
#reset_transform_matrix ⇒ void
Revert the transformation matrix to identity matrix.
-
#set_axis_orientation(xLeftRight, yBottomUp) ⇒ void
Sets the x and y axis orientation (i.e. the direction from lowest to highest values on the axis).
-
#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_device_origin(x, y) ⇒ void
Sets the device origin (i.e. the origin in pixels after scaling has been applied).
-
#set_font(font) ⇒ void
(also: #font=)
Sets the current font for the DC.
-
#set_graphics_context(ctx) ⇒ void
(also: #graphics_context=)
Associate a GraphicsContext with the DC.
-
#set_layout_direction(dir) ⇒ void
(also: #layout_direction=)
Sets the current layout direction for the device context.
-
#set_logical_function(function) ⇒ void
(also: #logical_function=)
Sets the current logical function for the device context.
-
#set_logical_origin(x, y) ⇒ void
Change the offset used for translating DC coordinates.
-
#set_logical_scale(x, y) ⇒ void
Set the scale to use for translating DC coordinates to the physical pixels.
-
#set_map_mode(mode) ⇒ void
(also: #map_mode=)
The mapping mode of the device context defines the unit of measurement used to convert logical units to device units.
-
#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.
-
#set_transform_matrix(matrix) ⇒ Boolean
(also: #transform_matrix=)
Set the transformation matrix.
-
#set_user_scale(xScale, yScale) ⇒ void
Sets the user scaling factor, useful for applications which require ‘zooming’.
-
#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.
- #to_dip(*args) ⇒ Object
-
#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 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.
1085 |
# File 'lib/wx/doc/gen/dc.rb', line 1085 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
993 |
# File 'lib/wx/doc/gen/dc.rb', line 993 def calc_bounding_box(x, y) end |
#can_draw_bitmap ⇒ Boolean Also known as: can_draw_bitmap?
Does the DC support drawing bitmaps?
1213 |
# File 'lib/wx/doc/gen/dc.rb', line 1213 def can_draw_bitmap; end |
#can_get_text_extent ⇒ Boolean Also known as: can_get_text_extent?
Does the DC support calculating the size required to draw text?
1218 |
# File 'lib/wx/doc/gen/dc.rb', line 1218 def can_get_text_extent; end |
#can_use_transform_matrix ⇒ Boolean Also known as: can_use_transform_matrix?
Check if the use of transformation matrix is supported by the current system.
This function returns true for MSW and GTK+ 3 platforms and since 3.1.1 also for GCDC in all ports.
1189 |
# File 'lib/wx/doc/gen/dc.rb', line 1189 def can_use_transform_matrix; 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.
323 |
# File 'lib/wx/doc/gen/dc.rb', line 323 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.
1241 |
# File 'lib/wx/doc/gen/dc.rb', line 1241 def copy_attributes(dc) end |
#cross_hair(x, y) ⇒ void #cross_hair(pt) ⇒ void
744 |
# File 'lib/wx/doc/gen/dc.rb', line 744 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.
751 |
# File 'lib/wx/doc/gen/dc.rb', line 751 def destroy_clipping_region; end |
#device_to_logical(x, y) ⇒ Wx::Point #device_to_logical(pt) ⇒ Wx::Point
279 |
# File 'lib/wx/doc/gen/dc.rb', line 279 def device_to_logical(*args) end |
#device_to_logical_rel(x, y) ⇒ Wx::Size #device_to_logical_rel(dim) ⇒ Wx::Size
292 |
# File 'lib/wx/doc/gen/dc.rb', line 292 def device_to_logical_rel(*args) end |
#device_to_logical_x(x) ⇒ Integer
Convert device X coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
183 |
# File 'lib/wx/doc/gen/dc.rb', line 183 def device_to_logical_x(x) end |
#device_to_logical_x_rel(x) ⇒ Integer
Convert device X coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
Use this for converting a horizontal distance like for example a width.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
196 |
# File 'lib/wx/doc/gen/dc.rb', line 196 def device_to_logical_x_rel(x) end |
#device_to_logical_y(y) ⇒ Integer
Converts device Y coordinate to logical coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
207 |
# File 'lib/wx/doc/gen/dc.rb', line 207 def device_to_logical_y(y) end |
#device_to_logical_y_rel(y) ⇒ Integer
Convert device Y coordinate to relative logical coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
Use this for converting a vertical distance like for example a height.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
220 |
# File 'lib/wx/doc/gen/dc.rb', line 220 def device_to_logical_y_rel(y) end |
#draw_arc(xStart, yStart, xEnd, yEnd, xc, yc) ⇒ void #draw_arc(ptStart, ptEnd, centre) ⇒ void
350 |
# File 'lib/wx/doc/gen/dc.rb', line 350 def draw_arc(*args) end |
#draw_bitmap(bitmap, x, y, useMask = false) ⇒ void #draw_bitmap(bmp, pt, useMask = false) ⇒ void
371 |
# File 'lib/wx/doc/gen/dc.rb', line 371 def draw_bitmap(*args) end |
#draw_check_mark(x, y, width, height) ⇒ void #draw_check_mark(rect) ⇒ void
384 |
# File 'lib/wx/doc/gen/dc.rb', line 384 def draw_check_mark(*args) end |
#draw_circle(x, y, radius) ⇒ void #draw_circle(pt, radius) ⇒ void
400 |
# File 'lib/wx/doc/gen/dc.rb', line 400 def draw_circle(*args) end |
#draw_ellipse(x, y, width, height) ⇒ void #draw_ellipse(pt, size) ⇒ void #draw_ellipse(rect) ⇒ void
421 |
# File 'lib/wx/doc/gen/dc.rb', line 421 def draw_ellipse(*args) end |
#draw_elliptic_arc(x, y, width, height, start, end_) ⇒ void #draw_elliptic_arc(pt, sz, sa, ea) ⇒ void
446 |
# File 'lib/wx/doc/gen/dc.rb', line 446 def draw_elliptic_arc(*args) end |
#draw_icon(icon, x, y) ⇒ void #draw_icon(icon, pt) ⇒ void
461 |
# File 'lib/wx/doc/gen/dc.rb', line 461 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
479 |
# File 'lib/wx/doc/gen/dc.rb', line 479 def draw_label(*args) end |
#draw_line(x1, y1, x2, y2) ⇒ void #draw_line(pt1, pt2) ⇒ void
495 |
# File 'lib/wx/doc/gen/dc.rb', line 495 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.
504 |
# File 'lib/wx/doc/gen/dc.rb', line 504 def draw_lines(points, xoffset=0, yoffset=0) end |
#draw_point(x, y) ⇒ void #draw_point(pt) ⇒ void
517 |
# File 'lib/wx/doc/gen/dc.rb', line 517 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.
543 |
# File 'lib/wx/doc/gen/dc.rb', line 543 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.
529 |
# File 'lib/wx/doc/gen/dc.rb', line 529 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
564 |
# File 'lib/wx/doc/gen/dc.rb', line 564 def draw_rectangle(*args) end |
#draw_rotated_text(text, x, y, angle) ⇒ void #draw_rotated_text(text, point, angle) ⇒ void
588 |
# File 'lib/wx/doc/gen/dc.rb', line 588 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
612 |
# File 'lib/wx/doc/gen/dc.rb', line 612 def draw_rounded_rectangle(*args) end |
#draw_spline(points) ⇒ void #draw_spline(x1, y1, x2, y2, x3, y3) ⇒ void
635 |
# File 'lib/wx/doc/gen/dc.rb', line 635 def draw_spline(*args) end |
#draw_text(text, x, y) ⇒ void #draw_text(text, pt) ⇒ void
657 |
# File 'lib/wx/doc/gen/dc.rb', line 657 def draw_text(*args) end |
#end_doc ⇒ void
This method returns an undefined value.
Ends a document (only relevant when outputting to a printer).
1031 |
# File 'lib/wx/doc/gen/dc.rb', line 1031 def end_doc; end |
#end_page ⇒ void
This method returns an undefined value.
Ends a document page (only relevant when outputting to a printer).
1035 |
# File 'lib/wx/doc/gen/dc.rb', line 1035 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
731 |
# File 'lib/wx/doc/gen/dc.rb', line 731 def flood_fill(*args) end |
#from_dip(sz) ⇒ Wx::Size #from_dip(pt) ⇒ Wx::Point #from_dip(d) ⇒ Integer
1331 |
# File 'lib/wx/doc/gen/dc.rb', line 1331 def from_dip(*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.
1454 |
# File 'lib/wx/doc/gen/dc.rb', line 1454 def get_as_bitmap(subrect=nil) end |
#get_background ⇒ Wx::Brush Also known as: background
Gets the brush used for painting the background.
1141 |
# File 'lib/wx/doc/gen/dc.rb', line 1141 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.
910 |
# File 'lib/wx/doc/gen/dc.rb', line 910 def get_background_mode; end |
#get_brush ⇒ Wx::Brush Also known as: brush
Gets the current brush.
1149 |
# File 'lib/wx/doc/gen/dc.rb', line 1149 def get_brush; end |
#get_char_height ⇒ Integer Also known as: char_height
Gets the character height of the currently set font.
820 |
# File 'lib/wx/doc/gen/dc.rb', line 820 def get_char_height; end |
#get_char_width ⇒ Integer Also known as: char_width
Gets the average character width of the currently set font.
825 |
# File 'lib/wx/doc/gen/dc.rb', line 825 def get_char_width; end |
#get_clipping_box(x, y) ⇒ Array(Boolean,Integer,Integer) #get_clipping_box(rect) ⇒ Boolean Also known as: clipping_box
772 |
# File 'lib/wx/doc/gen/dc.rb', line 772 def get_clipping_box(*args) end |
#get_content_scale_factor ⇒ Float Also known as: content_scale_factor
Returns the factor used for converting logical pixels to physical ones.
Returns the same value as Window#get_dpi_scale_factor for the device contexts associated with a window and the same value as Bitmap#get_scale_factor for the associated bitmap for MemoryDC.
Beware that since wxWidgets 3.1.6, this function does not return the same value as Window#get_content_scale_factor for the device contexts associated with the window. Unlike Window method, it always returns the effective scale factor instead of always returning 1 on platforms where logical pixels are the same as physical ones, such as MSW.
1253 |
# File 'lib/wx/doc/gen/dc.rb', line 1253 def get_content_scale_factor; end |
#get_depth ⇒ Integer Also known as: depth
Returns the depth (number of bits/pixel) of this DC.
1261 |
# File 'lib/wx/doc/gen/dc.rb', line 1261 def get_depth; end |
#get_device_origin ⇒ Wx::Point Also known as: device_origin
Returns the current device origin.
1269 |
# File 'lib/wx/doc/gen/dc.rb', line 1269 def get_device_origin; end |
#get_dimensions ⇒ Array(Integer,Integer) Also known as: dimensions
Gets the horizontal and vertical extent of this device context in device units.
It can be used to scale graphics to fit the page. For example, if maxX and maxY represent the maximum horizontal and vertical ‘pixel’ values used in your application, the following code will scale the graphic to fit on the printer page:
sz = dc.get_dimensions
scaleX = (maxX.to_f / sz.width)
scaleY = (maxY.to_f / sz.height);
dc.set_user_scale([scaleX, scaleY].min,[scaleX, scaleY].min)
1363 |
# File 'lib/wx/doc/gen/dc.rb', line 1363 def get_dimensions; end |
#get_dimensions_mm ⇒ Array(Integer,Integer) Also known as: dimensions_mm
Returns the horizontal and vertical resolution in millimetres.
1373 |
# File 'lib/wx/doc/gen/dc.rb', line 1373 def get_dimensions_mm; end |
#get_font ⇒ Wx::Font, Wx::FontInfo Also known as: font
917 |
# File 'lib/wx/doc/gen/dc.rb', line 917 def get_font; end |
#get_font_metrics ⇒ Wx::FontMetrics Also known as: font_metrics
Returns the various font characteristics.
This method allows retrieving some of the font characteristics not returned by #get_text_extent, notably internal leading and average character width. Currently this method returns correct results only under WXMSW, in the other ports the internal leading will always be 0 and the average character width will be computed as the width of the character ‘x’.
833 |
# File 'lib/wx/doc/gen/dc.rb', line 833 def get_font_metrics; 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 NULL is returned.
1484 |
# File 'lib/wx/doc/gen/dc.rb', line 1484 def get_graphics_context; end |
#get_layout_direction ⇒ Wx::LayoutDirection Also known as: layout_direction
Gets the current layout direction of the device context.
On platforms where RTL layout is supported, the return value will either be LayoutDirection::Layout_LeftToRight or LayoutDirection::Layout_RightToLeft. If RTL layout is not supported, the return value will be LayoutDirection::Layout_Default.
925 |
# File 'lib/wx/doc/gen/dc.rb', line 925 def get_layout_direction; end |
#get_logical_function ⇒ Wx::RasterOperationMode Also known as: logical_function
Gets the current logical function.
1277 |
# File 'lib/wx/doc/gen/dc.rb', line 1277 def get_logical_function; end |
#get_logical_origin ⇒ Wx::Point Also known as: logical_origin
Return the coordinates of the logical point (0, 0).
1226 |
# File 'lib/wx/doc/gen/dc.rb', line 1226 def get_logical_origin; end |
#get_logical_scale ⇒ Array(Float,Float) Also known as: logical_scale
Return the scale set by the last call to #set_logical_scale.
1467 |
# File 'lib/wx/doc/gen/dc.rb', line 1467 def get_logical_scale; end |
#get_map_mode ⇒ Wx::MappingMode Also known as: map_mode
Gets the current mapping mode for the device context.
1285 |
# File 'lib/wx/doc/gen/dc.rb', line 1285 def get_map_mode; end |
#get_multi_line_text_extent(string, font = nil) ⇒ Array(Integer,Integer,Integer) Also known as: multi_line_text_extent
Gets the dimensions of the string using the currently selected font.
string is the text string to measure, heightLine, if non NULL, is where to store the height of a single line. The text extent is set in the given w and h pointers. If the optional parameter font is specified and valid, then it is used for the text extent calculation, otherwise the currently selected font is used. If string is empty, its horizontal extent is 0 but, for convenience when using this function for allocating enough space for a possibly multi-line string, its vertical extent is the same as the height of an empty line of text. Please note that this behaviour differs from that of #get_text_extent.
This function works with both single-line and multi-line strings.
855 |
# File 'lib/wx/doc/gen/dc.rb', line 855 def get_multi_line_text_extent(string, font=nil) end |
#get_multi_line_text_size(string) ⇒ Wx::Size Also known as: multi_line_text_size
Gets the dimensions of the string using the currently selected font.
string is the text string to measure. The text extent as a Size object.
This function works with both single-line and multi-line strings.
874 |
# File 'lib/wx/doc/gen/dc.rb', line 874 def get_multi_line_text_size(string) end |
#get_pen ⇒ Wx::Pen Also known as: pen
Gets the current pen.
1157 |
# File 'lib/wx/doc/gen/dc.rb', line 1157 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.
1307 |
# File 'lib/wx/doc/gen/dc.rb', line 1307 def get_pixel(x, y, colour) end |
#get_ppi ⇒ Wx::Size Also known as: ppi
Returns the resolution of the device in pixels per inch.
1312 |
# File 'lib/wx/doc/gen/dc.rb', line 1312 def get_ppi; end |
#get_size ⇒ Wx::Size Also known as: size
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
1368 |
# File 'lib/wx/doc/gen/dc.rb', line 1368 def get_size; end |
#get_size_mm ⇒ Wx::Size Also known as: size_mm
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
1378 |
# File 'lib/wx/doc/gen/dc.rb', line 1378 def get_size_mm; end |
#get_text_background ⇒ Wx::Colour, ... Also known as: text_background
Gets the current text background colour.
933 |
# File 'lib/wx/doc/gen/dc.rb', line 933 def get_text_background; end |
#get_text_extent(string, font = nil) ⇒ Array(Integer,Integer,Integer,Integer) Also known as: text_extent
Gets the dimensions of the string using the currently selected font.
string is the text string to measure, descent is the dimension from the baseline of the font to the bottom of the descender, and externalLeading is any extra vertical space added to the font by the font designer (usually is zero). The text extent is returned in w and h pointers or as a Size object depending on which version of this function is used. If the optional parameter font is specified and valid, then it is used for the text extent calculation. Otherwise the currently selected font is. If string is empty, its extent is 0 in both directions, as expected.
This function only works with single-line strings.
896 |
# File 'lib/wx/doc/gen/dc.rb', line 896 def get_text_extent(string, font=nil) end |
#get_text_foreground ⇒ Wx::Colour, ... Also known as: text_foreground
Gets the current text foreground colour.
941 |
# File 'lib/wx/doc/gen/dc.rb', line 941 def get_text_foreground; end |
#get_text_size(string) ⇒ Wx::Size Also known as: text_size
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
902 |
# File 'lib/wx/doc/gen/dc.rb', line 902 def get_text_size(string) end |
#get_transform_matrix ⇒ Wx::AffineMatrix2D Also known as: transform_matrix
Return the transformation matrix used by this device context.
By default the transformation matrix is the identity matrix.
1204 |
# File 'lib/wx/doc/gen/dc.rb', line 1204 def get_transform_matrix; end |
#get_user_scale ⇒ Array(Float,Float) Also known as: user_scale
Gets the current user scale factor.
1386 |
# File 'lib/wx/doc/gen/dc.rb', line 1386 def get_user_scale; end |
#gradient_fill_concentric(rect, initialColour, destColour) ⇒ void #gradient_fill_concentric(rect, initialColour, destColour, circleCenter) ⇒ void
688 |
# File 'lib/wx/doc/gen/dc.rb', line 688 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.
698 |
# File 'lib/wx/doc/gen/dc.rb', line 698 def gradient_fill_linear(rect, initialColour, destColour, nDirection=Wx::Direction::RIGHT) end |
#is_ok ⇒ Boolean Also known as: ok?
Returns true if the DC is ok to use.
1391 |
# File 'lib/wx/doc/gen/dc.rb', line 1391 def is_ok; end |
#logical_to_device(x, y) ⇒ Wx::Point #logical_to_device(pt) ⇒ Wx::Point
303 |
# File 'lib/wx/doc/gen/dc.rb', line 303 def logical_to_device(*args) end |
#logical_to_device_rel(x, y) ⇒ Wx::Size #logical_to_device_rel(dim) ⇒ Wx::Size
316 |
# File 'lib/wx/doc/gen/dc.rb', line 316 def logical_to_device_rel(*args) end |
#logical_to_device_x(x) ⇒ Integer
Converts logical X coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
231 |
# File 'lib/wx/doc/gen/dc.rb', line 231 def logical_to_device_x(x) end |
#logical_to_device_x_rel(x) ⇒ Integer
Converts logical X coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
Use this for converting a horizontal distance like for example a width.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
244 |
# File 'lib/wx/doc/gen/dc.rb', line 244 def logical_to_device_x_rel(x) end |
#logical_to_device_y(y) ⇒ Integer
Converts logical Y coordinate to device coordinate, using the current mapping mode, user scale factor, device origin and axis orientation.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
255 |
# File 'lib/wx/doc/gen/dc.rb', line 255 def logical_to_device_y(y) end |
#logical_to_device_y_rel(y) ⇒ Integer
Converts logical Y coordinate to relative device coordinate, using the current mapping mode and user scale factor but ignoring the axis orientation.
Use this for converting a vertical distance like for example a height.
Affine transformation applied to the coordinate system with #set_transform_matrix is not taken into account.
268 |
# File 'lib/wx/doc/gen/dc.rb', line 268 def logical_to_device_y_rel(y) end |
#max_x ⇒ Integer
Gets the maximum horizontal extent used in drawing commands so far.
997 |
# File 'lib/wx/doc/gen/dc.rb', line 997 def max_x; end |
#max_y ⇒ Integer
Gets the maximum vertical extent used in drawing commands so far.
1001 |
# File 'lib/wx/doc/gen/dc.rb', line 1001 def max_y; end |
#min_x ⇒ Integer
Gets the minimum horizontal extent used in drawing commands so far.
1005 |
# File 'lib/wx/doc/gen/dc.rb', line 1005 def min_x; end |
#min_y ⇒ Integer
Gets the minimum vertical extent used in drawing commands so far.
1009 |
# File 'lib/wx/doc/gen/dc.rb', line 1009 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.
1016 |
# File 'lib/wx/doc/gen/dc.rb', line 1016 def reset_bounding_box; end |
#reset_transform_matrix ⇒ void
This method returns an undefined value.
Revert the transformation matrix to identity matrix.
1209 |
# File 'lib/wx/doc/gen/dc.rb', line 1209 def reset_transform_matrix; end |
#set_axis_orientation(xLeftRight, yBottomUp) ⇒ void
This method returns an undefined value.
Sets the x and y axis orientation (i.e. the direction from lowest to highest values on the axis).
The default orientation is x axis from left to right and y axis from top down.
1400 |
# File 'lib/wx/doc/gen/dc.rb', line 1400 def set_axis_orientation(xLeftRight, yBottomUp) end |
#set_background(brush) ⇒ void Also known as: background=
This method returns an undefined value.
Sets the current background brush for the DC.
1163 |
# File 'lib/wx/doc/gen/dc.rb', line 1163 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.
950 |
# File 'lib/wx/doc/gen/dc.rb', line 950 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.
1173 |
# File 'lib/wx/doc/gen/dc.rb', line 1173 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=
807 |
# File 'lib/wx/doc/gen/dc.rb', line 807 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.
815 |
# File 'lib/wx/doc/gen/dc.rb', line 815 def set_device_clipping_region(region) end |
#set_device_origin(x, y) ⇒ void
This method returns an undefined value.
Sets the device origin (i.e. the origin in pixels after scaling has been applied).
This function may be useful in Windows printing operations for placing a graphic on a page.
1408 |
# File 'lib/wx/doc/gen/dc.rb', line 1408 def set_device_origin(x, y) end |
#set_font(font) ⇒ void Also known as: font=
This method returns an undefined value.
Sets the current font for the DC.
The font parameter should be valid, although in WXMSW port (only) the argument NULL_FONT is also accepted and resets the device context font to the default value used by the system (which is not generally useful).
959 |
# File 'lib/wx/doc/gen/dc.rb', line 959 def set_font(font) 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.
1492 |
# File 'lib/wx/doc/gen/dc.rb', line 1492 def set_graphics_context(ctx) end |
#set_layout_direction(dir) ⇒ void Also known as: layout_direction=
This method returns an undefined value.
Sets the current layout direction for the device context.
983 |
# File 'lib/wx/doc/gen/dc.rb', line 983 def set_layout_direction(dir) 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.
1423 |
# File 'lib/wx/doc/gen/dc.rb', line 1423 def set_logical_function(function) end |
#set_logical_origin(x, y) ⇒ void
This method returns an undefined value.
Change the offset used for translating Wx::DC coordinates.
1478 |
# File 'lib/wx/doc/gen/dc.rb', line 1478 def set_logical_origin(x, y) end |
#set_logical_scale(x, y) ⇒ void
This method returns an undefined value.
Set the scale to use for translating Wx::DC coordinates to the physical pixels.
The effect of calling this function is similar to that of calling #set_user_scale.
1463 |
# File 'lib/wx/doc/gen/dc.rb', line 1463 def set_logical_scale(x, y) end |
#set_map_mode(mode) ⇒ void Also known as: map_mode=
This method returns an undefined value.
The mapping mode of the device context defines the unit of measurement used to convert logical units to device units.
Note that in X, text drawing isn’t handled consistently with the mapping mode; a font is always specified in point size. However, setting the user scale (see #set_user_scale) scales the text appropriately. In Windows, scalable TrueType fonts are always used; in X, results depend on availability of fonts, but usually a reasonable match is found. The coordinate origin is always at the top left of the screen/printer. Drawing to a Windows printer device context uses the current mapping mode, but mapping mode is currently ignored for PostScript output.
1433 |
# File 'lib/wx/doc/gen/dc.rb', line 1433 def set_map_mode(mode) 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.
1442 |
# File 'lib/wx/doc/gen/dc.rb', line 1442 def set_palette(palette) end |
#set_pen(pen) ⇒ void Also known as: pen=
1182 |
# File 'lib/wx/doc/gen/dc.rb', line 1182 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.
965 |
# File 'lib/wx/doc/gen/dc.rb', line 965 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.
974 |
# File 'lib/wx/doc/gen/dc.rb', line 974 def set_text_foreground(colour) end |
#set_transform_matrix(matrix) ⇒ Boolean Also known as: transform_matrix=
Set the transformation matrix.
If transformation matrix is supported on the current system, the specified matrix will be used to transform between Wx::DC and physical coordinates. Otherwise the function returns false and doesn’t change the coordinate mapping.
1197 |
# File 'lib/wx/doc/gen/dc.rb', line 1197 def set_transform_matrix(matrix) end |
#set_user_scale(xScale, yScale) ⇒ void
This method returns an undefined value.
Sets the user scaling factor, useful for applications which require ‘zooming’.
1449 |
# File 'lib/wx/doc/gen/dc.rb', line 1449 def set_user_scale(xScale, yScale) end |
#start_doc(message) ⇒ Boolean
Starts a document (only relevant when outputting to a printer).
message is a message to show while printing.
1023 |
# File 'lib/wx/doc/gen/dc.rb', line 1023 def start_doc() end |
#start_page ⇒ void
This method returns an undefined value.
Starts a document page (only relevant when outputting to a printer).
1027 |
# File 'lib/wx/doc/gen/dc.rb', line 1027 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.
1134 |
# File 'lib/wx/doc/gen/dc.rb', line 1134 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 |
#to_dip(sz) ⇒ Wx::Size #to_dip(pt) ⇒ Wx::Point #to_dip(d) ⇒ Integer
1349 |
# File 'lib/wx/doc/gen/dc.rb', line 1349 def to_dip(*args) 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 |