SourceForge.net Graphics

Graphics

Graphics
Drawing, Text, Fonts

This section details functions and classes that are used to draw on windows. This includes drawing text (when a wxTextCtrl or wxStaticText don't do what you need).

Functions/Procedures
Subtopics

Graphics

[proc]
begin_drawing
( atom dc )

Category: Graphics

This must be called before you begin drawing to any window (i.e., not to a wxMemoryDC), and must be followed with a call to end_drawing() when finished.


Graphics

[proc]
blit
( atom dstDC, integer dstX, integer dstY, atom srcDC, integer srcX, integer srcY, integer height, integer width, integer operation )

Category: Graphics

Copy a bitmap from one DC to another.


Graphics

[proc]
clear_dc
( atom dc )

Category: Graphics

Clears the image currently in the dc.


Graphics

[proc]
draw_bitmap
( atom dc, atom bitmap, integer x, integer y, integer trans )

Category: Graphics

Draw a wxBitmap onto dc dest. Set trans to 1 if it has an associated mask, and should be drawn with transparency.


Graphics

[proc]
draw_icon
( atom dc, atom icon, atom x, atom y)

Category: Graphics

Draws a wxIcon to the DC dc.


Graphics

[proc]
draw_line
( atom dc, sequence points )

Category: Graphics

Draws a line using the current wxPen. points should be a 4-element sequence:

  draw_line( dc, {x1, y1, x2, y2})

Graphics

[proc]
draw_polygon
( atom dc, sequence points, atom x, atom y, atom style )

Category: Graphics

Draws a polygon in the specified dc. points is a sequence containing all of the points to be drawn. It should be of the form {x1,y1,x2,y2,...,xn,yn}. x and y are offset coordinates. The last argument specifies the fill rule:

The current pen is used for drawing the outline, and the current brush for filling the shape. Using a transparent brush suppresses filling.

Note that wxWidgets automatically closes the first and last points.


Graphics

[proc]
end_drawing
( atom dc )

Category: Graphics

This stops drawing to the specified DC. You should use this and begin_drawing to specify when drawing should begin and end on a wxDC.


Graphics

[func]
get_dc_size
( atom dc )

Category: Graphics

Returns the width and height of the dc in pixels.


Graphics

[func]
get_dc_text_extent
( atom dc, sequence text )

Category: Graphics


Graphics

[func]
get_first_region
( atom iter )

Category: Graphics


Graphics

[func]
get_next_region
( atom iter )

Category: Graphics

Returns a sequence with the x, y and width and height of the next region, or an empty sequence if the last region has already been accessed.


Graphics

[func]
get_regions
( atom window )

Category: Graphics

Returns a wxRegionIterator, which can be used in conjunction with get_next_region() to get all of the regions to be updated in an on paint event. This should only be called from within an on paint event.


Graphics

[func]
get_text_extent
( atom win, sequence text, atom font )

Category: Graphics


Graphics

[func]
get_user_scale
( atom dc, atom x, atom y )

Category: Graphics

Returns the scaling factors for the DC.


Graphics

[proc]
set_background_mode
( atom dc, atom mode )

Category: Graphics

mode may be either wxSOLID (text is drawn with a background color) or wxTRANSPARENT (text is drawn without a background color).


Graphics

[proc]
set_back_brush
( atom dc, atom brush )

Category: Graphics

Sets background brush to be the current wxBrush for dc wxDC.


Graphics

[proc]
set_brush
( atom dc, atom brush )

Category: Graphics

Sets brush to be the current wxBrush for dc wxDC.


Graphics

[proc]
set_default_font
( atom win, atom font )

Category: Graphics

Sets the default font for a window.


Graphics

[proc]
set_font
( atom dc, atom font )

Category: Graphics

Sets the font for a specified wxDC or wxPaintDC assiciated with a window. To set the default font for a window or control, you should use set_default_font().


Graphics

[proc]
set_pen
( atom dc, atom pen )

Category: Graphics

Sets pen to be the current wxPen for dc wxDC.


Graphics

[proc]
set_text_back_color
( atom dc, object color )

Category: Graphics

This sets a back color to the DC. Color can either be an RGB sequence {Red,Green,Blue} or a pointer to a wxColour.


Graphics

[proc]
set_text_color
( atom dc, object color )

Category: Graphics

Set the current text foreground color. color can be either an RGB sequence, or a pointer to a wxColour object.


Graphics

[proc]
set_user_scale
( atom dc, atom x, atom y )

Category: Graphics

Sets the scaling factors for the DC.


Graphics

[proc]
wx_printf
( object win, sequence text, object format )

Category: Graphics

Works similar to printf().

win can take several forms:


Graphics

[proc]
wx_puts
( object win, sequence text )

Category: Graphics

Works similar to puts().