wx.DC Class Reference

Inheritance diagram for wx.DC:

wx.Object wx.WindowDC wx.ClientDC wx.MemoryDC wx.PaintDC wx.BufferedDC wx.BufferedPaintDC

List of all members.

Public Member Functions

bool Blit (Point destPt, Size sz, DC source, Point srcPt, int rop, bool useMask)
bool Blit (Point destPt, Size sz, DC source, Point srcPt, int rop)
bool Blit (Point destPt, Size sz, DC source, Point srcPt)
bool Blit (Point destPt, Size sz, DC source, Point srcPt, int rop, bool useMask, Point srcPtMask)
bool Blit (int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop, bool useMask, int xsrcMask)
bool Blit (int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop, bool useMask)
bool Blit (int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop)
bool Blit (int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc)
bool Blit (int xdest, int ydest, int width, int height, DC source)
bool Blit (int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop, bool useMask, int xsrcMask, int ysrcMask)
virtual void CalcBoundingBox (int x, int y)
virtual void Clear ()
void CrossHair (Point pt)
void CrossHair (int x, int y)
 DC (IntPtr wxObject, bool memOwn)
 DC (IntPtr wxObject)
void DestroyClippingRegion ()
int DeviceToLogicalX (int x)
int DeviceToLogicalXRel (int x)
int DeviceToLogicalY (int y)
int DeviceToLogicalYRel (int y)
void DrawArc (Point pt1, Point pt2, Point centre)
void DrawArc (int x1, int y1, int x2, int y2, int xc, int yc)
void DrawBitmap (Bitmap bmp, Point pt)
void DrawBitmap (Bitmap bmp, Point pt, bool transparent)
void DrawBitmap (Bitmap bmp, int x, int y)
void DrawBitmap (Bitmap bmp, int x, int y, bool transparent)
void DrawCheckMark (Rectangle rect)
void DrawCheckMark (int x, int y, int width, int height)
void DrawCircle (Point pt, int radius)
void DrawCircle (int x, int y, int radius)
void DrawEllipse (Rectangle rect)
void DrawEllipse (Point pt, Size sz)
void DrawEllipse (int x, int y, int width, int height)
void DrawEllipticArc (Point pt, Size sz, double sa, double ea)
void DrawEllipticArc (int x, int y, int w, int h, double sa, double ea)
void DrawIcon (Icon icon, Point pt)
void DrawIcon (Icon icon, int x, int y)
void DrawLabel (string text, Rectangle rect, int alignment)
void DrawLabel (string text, Rectangle rect)
void DrawLabel (string text, Rectangle rect, int alignment, int indexAccel)
virtual void DrawLabel (string text, Bitmap image, Rectangle rect, int alignment, int indexAccel)
virtual void DrawLabel (string text, Bitmap image, Rectangle rect, int alignment)
virtual void DrawLabel (string text, Bitmap image, Rectangle rect)
virtual void DrawLabel (string text, Bitmap image, Rectangle rect, int alignment, int indexAccel, ref Rectangle rectBounding)
void DrawLine (int x1, int y1, int x2, int y2)
void DrawLine (Point p1, Point p2)
void DrawLines (Point[] points, int xoffset)
void DrawLines (params Point[] points)
void DrawLines (Point[] points, int xoffset, int yoffset)
void DrawPoint (Point pt)
void DrawPoint (int x, int y)
void DrawPolygon (int n, Point[] points, int xoffset, int yoffset, FillRule fillStyle)
void DrawPolygon (int n, Point[] points, int xoffset, int yoffset)
void DrawPolygon (int n, Point[] points)
void DrawPolygon (Point[] points, int xoffset, int yoffset, FillRule fillStyle)
void DrawPolygon (Point[] points, int xoffset, int yoffset)
void DrawPolygon (Point[] points)
void DrawRectangle (Rectangle rect)
void DrawRectangle (Point pt, Size sz)
void DrawRectangle (int x1, int y1, int x2, int y2)
void DrawRotatedText (string text, Point pt, double angle)
void DrawRotatedText (string text, int x, int y, double angle)
void DrawRoundedRectangle (Rectangle r, double radius)
void DrawRoundedRectangle (Point pt, Size sz, double radius)
void DrawRoundedRectangle (int x, int y, int width, int height, double radius)
void DrawSpline (Point[] points)
void DrawSpline (int x1, int y1, int x2, int y2, int x3, int y3)
void DrawText (string text, Point pos)
void DrawText (string text, int x, int y)
virtual void EndDoc ()
virtual void EndPage ()
bool FloodFill (Point pt, Colour col, FloodStyle style)
bool FloodFill (Point pt, Colour col)
bool FloodFill (int x, int y, Colour col, FloodStyle style)
bool FloodFill (int x, int y, Colour col)
void GetDeviceOrigin (out int x, out int y)
void GetLogicalOrigin (out int x, out int y)
virtual void GetLogicalScale (out double x, out double y)
Size GetMultiLineTextExtent (string text)
virtual void GetMultiLineTextExtent (string text, out int width, out int height, out int heightline)
virtual void GetMultiLineTextExtent (string text, out int width, out int height)
virtual void GetMultiLineTextExtent (string text, out int width, out int height, out int heightline, Font font)
bool GetPartialTextExtents (string text, int[] widths)
bool GetPixel (Point pt, Colour col)
bool GetPixel (int x, int y, Colour col)
void GetSizeMM (out int width, out int height)
Size GetTextExtent (string str, wx.Font font)
Size GetTextExtent (string str)
void GetTextExtent (string str, out int w, out int h, out int descent, out int externalLeading)
void GetTextExtent (string str, out int w, out int h, out int descent, out int externalLeading, Font theFont)
void GetTextExtent (string str, out int w, out int h)
virtual void GetUserScale (out double x, out double y)
int LogicalToDeviceX (int x)
int LogicalToDeviceXRel (int x)
int LogicalToDeviceY (int y)
int LogicalToDeviceYRel (int y)
void ResetBoundingBox ()
void SetAxisOrientation (bool xLeftRight, bool yBottomUp)
void SetClippingRegion (Region reg)
void SetClippingRegion (Rectangle rect)
void SetClippingRegion (Point pos, Size size)
void SetClippingRegion (int x, int y, int width, int height)
void SetDeviceOrigin (int x, int y)
void SetLogicalOrigin (int x, int y)
virtual void SetLogicalScale (double x, double y)
virtual void SetUserScale (double x, double y)
virtual bool StartDoc (string message)
virtual void StartPage ()

Protected Member Functions

override void CallDTor ()

Properties

Brush Background [get, set]
DCBackgroundMode BackgroundMode [get, set]
Brush Brush [get, set]
int CharHeight [get]
int CharWidth [get]
Rectangle ClippingBox [get]
Point DeviceOrigin [get]
Font Font [get, set]
virtual Logic LogicalFunction [get, set]
Point LogicalOrigin [get]
MappingMode MapMode [get, set]
int MaxX [get]
int MaxY [get]
int MinX [get]
int MinY [get]
virtual bool Ok [get]
Pen Pen [get, set]
Size Size [get]
Size SizeMM [get]
Colour TextBackground [get, set]
Colour TextForeground [get, set]


Detailed Description

A device context for painting. Please note, that you have to dispose this context as soon as you stop drawing explicitely. In C++ wxWidgets this is done explicitely when creating objects of this class in a local scope. The object will be deleted when leaving this scope implicitely. However, .NET implements an implicit destruction of objects using a garbage collector. So, you have either to use the key word using or the ethod wx.Object.Dispose() to delete a DC immediately after using it.

Constructor & Destructor Documentation

wx.DC.DC ( IntPtr  wxObject  ) 

wx.DC.DC ( IntPtr  wxObject,
bool  memOwn 
)


Member Function Documentation

bool wx.DC.Blit ( Point  destPt,
Size  sz,
DC  source,
Point  srcPt,
int  rop,
bool  useMask 
)

bool wx.DC.Blit ( Point  destPt,
Size  sz,
DC  source,
Point  srcPt,
int  rop 
)

bool wx.DC.Blit ( Point  destPt,
Size  sz,
DC  source,
Point  srcPt 
)

bool wx.DC.Blit ( Point  destPt,
Size  sz,
DC  source,
Point  srcPt,
int  rop,
bool  useMask,
Point  srcPtMask 
)

bool wx.DC.Blit ( int  xdest,
int  ydest,
int  width,
int  height,
DC  source,
int  xsrc,
int  ysrc,
int  rop,
bool  useMask,
int  xsrcMask 
)

bool wx.DC.Blit ( int  xdest,
int  ydest,
int  width,
int  height,
DC  source,
int  xsrc,
int  ysrc,
int  rop,
bool  useMask 
)

bool wx.DC.Blit ( int  xdest,
int  ydest,
int  width,
int  height,
DC  source,
int  xsrc,
int  ysrc,
int  rop 
)

bool wx.DC.Blit ( int  xdest,
int  ydest,
int  width,
int  height,
DC  source,
int  xsrc,
int  ysrc 
)

bool wx.DC.Blit ( int  xdest,
int  ydest,
int  width,
int  height,
DC  source 
)

bool wx.DC.Blit ( int  xdest,
int  ydest,
int  width,
int  height,
DC  source,
int  xsrc,
int  ysrc,
int  rop,
bool  useMask,
int  xsrcMask,
int  ysrcMask 
)

virtual void wx.DC.CalcBoundingBox ( int  x,
int  y 
) [virtual]

override void wx.DC.CallDTor (  )  [protected, virtual]

This will be called by Dispose() to delete the C++ object. Overload this if you have to use another DTor.

Reimplemented from wx.Object.

virtual void wx.DC.Clear (  )  [virtual]

void wx.DC.CrossHair ( Point  pt  ) 

void wx.DC.CrossHair ( int  x,
int  y 
)

void wx.DC.DestroyClippingRegion (  ) 

Destroys the current clipping region so that none of the DC is clipped. See also SetClippingRegion.

int wx.DC.DeviceToLogicalX ( int  x  ) 

int wx.DC.DeviceToLogicalXRel ( int  x  ) 

int wx.DC.DeviceToLogicalY ( int  y  ) 

int wx.DC.DeviceToLogicalYRel ( int  y  ) 

void wx.DC.DrawArc ( Point  pt1,
Point  pt2,
Point  centre 
)

void wx.DC.DrawArc ( int  x1,
int  y1,
int  x2,
int  y2,
int  xc,
int  yc 
)

void wx.DC.DrawBitmap ( Bitmap  bmp,
Point  pt 
)

Draw a bitmap on the device context at the specified point. This will draw even transparent regions in the bitmap opaque.

When drawing a mono-bitmap, the current text foreground colour will be used to draw the foreground of the bitmap (all bits set to 1), and the current text background colour to draw the background (all bits set to 0). See also SetTextForeground, SetTextBackground and wx.MemoryDC.

Parameters:
bmp the bitmap that will be drawn
pt the position of the upper left corner of the bitmap in the DC.

void wx.DC.DrawBitmap ( Bitmap  bmp,
Point  pt,
bool  transparent 
)

Draw a bitmap on the device context at the specified point. If transparent is true and the bitmap has a transparency mask, the bitmap will be drawn transparently.

When drawing a mono-bitmap, the current text foreground colour will be used to draw the foreground of the bitmap (all bits set to 1), and the current text background colour to draw the background (all bits set to 0). See also SetTextForeground, SetTextBackground and wx.MemoryDC.

Parameters:
bmp the bitmap that will be drawn
pt the position of the upper left corner of the bitmap in the DC.
transparent If true draw with transparent background (if available)

void wx.DC.DrawBitmap ( Bitmap  bmp,
int  x,
int  y 
)

Draw a bitmap on the device context at the specified point. This will draw even transparent regions in the bitmap opaque.

When drawing a mono-bitmap, the current text foreground colour will be used to draw the foreground of the bitmap (all bits set to 1), and the current text background colour to draw the background (all bits set to 0). See also SetTextForeground, SetTextBackground and wx.MemoryDC.

Parameters:
bmp the bitmap that will be drawn
x the x position of the upper left corner of the bitmap in the DC.
y the y position of the upper left corner of the bitmap in the DC.

void wx.DC.DrawBitmap ( Bitmap  bmp,
int  x,
int  y,
bool  transparent 
)

Draw a bitmap on the device context at the specified point. If transparent is true and the bitmap has a transparency mask, the bitmap will be drawn transparently.

When drawing a mono-bitmap, the current text foreground colour will be used to draw the foreground of the bitmap (all bits set to 1), and the current text background colour to draw the background (all bits set to 0). See also SetTextForeground, SetTextBackground and wx.MemoryDC.

Parameters:
bmp the bitmap that will be drawn
x the x position of the upper left corner of the bitmap in the DC.
y the y position of the upper left corner of the bitmap in the DC.
transparent If true draw with transparent background (if available)

void wx.DC.DrawCheckMark ( Rectangle  rect  ) 

void wx.DC.DrawCheckMark ( int  x,
int  y,
int  width,
int  height 
)

void wx.DC.DrawCircle ( Point  pt,
int  radius 
)

void wx.DC.DrawCircle ( int  x,
int  y,
int  radius 
)

void wx.DC.DrawEllipse ( Rectangle  rect  ) 

void wx.DC.DrawEllipse ( Point  pt,
Size  sz 
)

void wx.DC.DrawEllipse ( int  x,
int  y,
int  width,
int  height 
)

void wx.DC.DrawEllipticArc ( Point  pt,
Size  sz,
double  sa,
double  ea 
)

void wx.DC.DrawEllipticArc ( int  x,
int  y,
int  w,
int  h,
double  sa,
double  ea 
)

void wx.DC.DrawIcon ( Icon  icon,
Point  pt 
)

void wx.DC.DrawIcon ( Icon  icon,
int  x,
int  y 
)

void wx.DC.DrawLabel ( string  text,
Rectangle  rect,
int  alignment 
)

void wx.DC.DrawLabel ( string  text,
Rectangle  rect 
)

void wx.DC.DrawLabel ( string  text,
Rectangle  rect,
int  alignment,
int  indexAccel 
)

virtual void wx.DC.DrawLabel ( string  text,
Bitmap  image,
Rectangle  rect,
int  alignment,
int  indexAccel 
) [virtual]

virtual void wx.DC.DrawLabel ( string  text,
Bitmap  image,
Rectangle  rect,
int  alignment 
) [virtual]

virtual void wx.DC.DrawLabel ( string  text,
Bitmap  image,
Rectangle  rect 
) [virtual]

virtual void wx.DC.DrawLabel ( string  text,
Bitmap  image,
Rectangle  rect,
int  alignment,
int  indexAccel,
ref Rectangle  rectBounding 
) [virtual]

void wx.DC.DrawLine ( int  x1,
int  y1,
int  x2,
int  y2 
)

void wx.DC.DrawLine ( Point  p1,
Point  p2 
)

void wx.DC.DrawLines ( Point[]  points,
int  xoffset 
)

Draws lines using an array of points of size n, or list of pointers to points, adding the optional offset coordinate. The current pen is used for drawing the lines. The programmer is responsible for deleting the list of points.

Parameters:
points Array of points
xoffset Optional offset in X direction

void wx.DC.DrawLines ( params Point[]  points  ) 

Draws lines using an array of points of size n, or list of pointers to points, adding the optional offset coordinate. The current pen is used for drawing the lines. The programmer is responsible for deleting the list of points.

Parameters:
points Array of points

void wx.DC.DrawLines ( Point[]  points,
int  xoffset,
int  yoffset 
)

Draws lines using an array of points of size n, or list of pointers to points, adding the optional offset coordinate. The current pen is used for drawing the lines. The programmer is responsible for deleting the list of points.

Parameters:
points Array of points
xoffset Optional offset in X direction
yoffset Optional offset in Y direction

void wx.DC.DrawPoint ( Point  pt  ) 

void wx.DC.DrawPoint ( int  x,
int  y 
)

void wx.DC.DrawPolygon ( int  n,
Point[]  points,
int  xoffset,
int  yoffset,
FillRule  fillStyle 
)

void wx.DC.DrawPolygon ( int  n,
Point[]  points,
int  xoffset,
int  yoffset 
)

void wx.DC.DrawPolygon ( int  n,
Point[]  points 
)

void wx.DC.DrawPolygon ( Point[]  points,
int  xoffset,
int  yoffset,
FillRule  fillStyle 
)

void wx.DC.DrawPolygon ( Point[]  points,
int  xoffset,
int  yoffset 
)

void wx.DC.DrawPolygon ( Point[]  points  ) 

void wx.DC.DrawRectangle ( Rectangle  rect  ) 

void wx.DC.DrawRectangle ( Point  pt,
Size  sz 
)

void wx.DC.DrawRectangle ( int  x1,
int  y1,
int  x2,
int  y2 
)

void wx.DC.DrawRotatedText ( string  text,
Point  pt,
double  angle 
)

void wx.DC.DrawRotatedText ( string  text,
int  x,
int  y,
double  angle 
)

void wx.DC.DrawRoundedRectangle ( Rectangle  r,
double  radius 
)

void wx.DC.DrawRoundedRectangle ( Point  pt,
Size  sz,
double  radius 
)

void wx.DC.DrawRoundedRectangle ( int  x,
int  y,
int  width,
int  height,
double  radius 
)

void wx.DC.DrawSpline ( Point[]  points  ) 

void wx.DC.DrawSpline ( int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)

void wx.DC.DrawText ( string  text,
Point  pos 
)

Draws a text string at the specified point, using the current text font, and the current text foreground and background colours.

The coordinates refer to the top-left corner of the rectangle bounding the string. See GetTextExtent for how to get the dimensions of a text string, which can be used to position the text more precisely.

NB: under wxGTK the current logical function is used by this function but it is ignored by wxMSW. Thus, you should avoid using logical functions with this function in portable programs.

Parameters:
text Text that will be drawn.
pos Position of the upper left corner of the text in the DC.

void wx.DC.DrawText ( string  text,
int  x,
int  y 
)

Draws a text string at the specified point, using the current text font, and the current text foreground and background colours.

The coordinates refer to the top-left corner of the rectangle bounding the string. See GetTextExtent for how to get the dimensions of a text string, which can be used to position the text more precisely.

NB: under wxGTK the current logical function is used by this function but it is ignored by wxMSW. Thus, you should avoid using logical functions with this function in portable programs.

Parameters:
text Text that will be drawn.
x X position of the upper left corner of the text in the DC.
y Y position of the upper left corner of teh text in the DC.

virtual void wx.DC.EndDoc (  )  [virtual]

virtual void wx.DC.EndPage (  )  [virtual]

bool wx.DC.FloodFill ( Point  pt,
Colour  col,
FloodStyle  style 
)

bool wx.DC.FloodFill ( Point  pt,
Colour  col 
)

bool wx.DC.FloodFill ( int  x,
int  y,
Colour  col,
FloodStyle  style 
)

bool wx.DC.FloodFill ( int  x,
int  y,
Colour  col 
)

void wx.DC.GetDeviceOrigin ( out int  x,
out int  y 
)

void wx.DC.GetLogicalOrigin ( out int  x,
out int  y 
)

virtual void wx.DC.GetLogicalScale ( out double  x,
out double  y 
) [virtual]

Size wx.DC.GetMultiLineTextExtent ( string  text  ) 

virtual void wx.DC.GetMultiLineTextExtent ( string  text,
out int  width,
out int  height,
out int  heightline 
) [virtual]

virtual void wx.DC.GetMultiLineTextExtent ( string  text,
out int  width,
out int  height 
) [virtual]

virtual void wx.DC.GetMultiLineTextExtent ( string  text,
out int  width,
out int  height,
out int  heightline,
Font  font 
) [virtual]

bool wx.DC.GetPartialTextExtents ( string  text,
int[]  widths 
)

bool wx.DC.GetPixel ( Point  pt,
Colour  col 
)

bool wx.DC.GetPixel ( int  x,
int  y,
Colour  col 
)

void wx.DC.GetSizeMM ( out int  width,
out int  height 
)

Returns the horizontal and vertical resolution in millimetres.

Parameters:
width Variable that will be loaded with the width.
height Variable that will be loaded with the height.

Size wx.DC.GetTextExtent ( string  str,
wx.Font  font 
)

Returns width and height of string str using the designated font.

Parameters:
str str is the text string to measure, w and h are the total width and height respectively.
font The parameter font specifies an alternative to the currently selected font: but note that this does not yet work under Windows, so you need to set a font for the device context first.

Size wx.DC.GetTextExtent ( string  str  ) 

Returns width and height of string str using the font of the this.

Parameters:
str str is the text string to measure, w and h are the total width and height respectively.
font The parameter font specifies an alternative to the currently selected font: but note that this does not yet work under Windows, so you need to set a font for the device context first.

void wx.DC.GetTextExtent ( string  str,
out int  w,
out int  h,
out int  descent,
out int  externalLeading 
)

Gets the dimensions of the string using the currently selected font.

Parameters:
str str is the text string to measure, w and h are the total width and height respectively.
w 
h 
descent descent is the dimension from the baseline of the font to the bottom of the descender.
externalLeading externalLeading is any extra vertical space added to the font by the font designer (usually is zero).

void wx.DC.GetTextExtent ( string  str,
out int  w,
out int  h,
out int  descent,
out int  externalLeading,
Font  theFont 
)

Gets the dimensions of the string using the currently selected font.

Parameters:
str str is the text string to measure, w and h are the total width and height respectively.
w 
h 
descent descent is the dimension from the baseline of the font to the bottom of the descender.
externalLeading externalLeading is any extra vertical space added to the font by the font designer (usually is zero).
theFont The parameter font specifies an alternative to the currently selected font: but note that this does not yet work under Windows, so you need to set a font for the device context first.

void wx.DC.GetTextExtent ( string  str,
out int  w,
out int  h 
)

Gets the dimensions of the string using the currently selected font.

Parameters:
str str is the text string to measure, w and h are the total width and height respectively.
w 
h 

virtual void wx.DC.GetUserScale ( out double  x,
out double  y 
) [virtual]

int wx.DC.LogicalToDeviceX ( int  x  ) 

int wx.DC.LogicalToDeviceXRel ( int  x  ) 

int wx.DC.LogicalToDeviceY ( int  y  ) 

int wx.DC.LogicalToDeviceYRel ( int  y  ) 

void wx.DC.ResetBoundingBox (  ) 

void wx.DC.SetAxisOrientation ( bool  xLeftRight,
bool  yBottomUp 
)

void wx.DC.SetClippingRegion ( Region  reg  ) 

Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. You should call DestroyClippingRegion if you want to set the clipping region exactly to the region specified.

The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.

void wx.DC.SetClippingRegion ( Rectangle  rect  ) 

Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. You should call DestroyClippingRegion if you want to set the clipping region exactly to the region specified.

The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.

void wx.DC.SetClippingRegion ( Point  pos,
Size  size 
)

Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. You should call DestroyClippingRegion if you want to set the clipping region exactly to the region specified.

The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.

void wx.DC.SetClippingRegion ( int  x,
int  y,
int  width,
int  height 
)

Sets the clipping region for this device context to the intersection of the given region described by the parameters of this method and the previously set clipping region. You should call DestroyClippingRegion if you want to set the clipping region exactly to the region specified.

The clipping region is an area to which drawing is restricted. Possible uses for the clipping region are for clipping text or for speeding up window redraws when only a known area of the screen is damaged.

void wx.DC.SetDeviceOrigin ( int  x,
int  y 
)

void wx.DC.SetLogicalOrigin ( int  x,
int  y 
)

virtual void wx.DC.SetLogicalScale ( double  x,
double  y 
) [virtual]

virtual void wx.DC.SetUserScale ( double  x,
double  y 
) [virtual]

Sets the user scaling factor, useful for applications which require 'zooming'.

Parameters:
x Scaling factor in X direction
y scaling factor in Y direction.

virtual bool wx.DC.StartDoc ( string  message  )  [virtual]

virtual void wx.DC.StartPage (  )  [virtual]


Property Documentation

Brush wx.DC.Background [get, set]

The brush that will be used to draw the background. This gets exactly the instance that will be used for drawing. Thus, beware of side effects.

DCBackgroundMode wx.DC.BackgroundMode [get, set]

Returns or defines the background mode of the window.

Brush wx.DC.Brush [get, set]

The brush that will be used to draw squares and elipses. This gets exactly the instance that will be used for drawing. Thus, beware of side effects.

int wx.DC.CharHeight [get]

Gets the character height of the currently set font.

int wx.DC.CharWidth [get]

Gets the average character width of the currently set font.

Rectangle wx.DC.ClippingBox [get]

Gets the rectangle surrounding the current clipping region.

Point wx.DC.DeviceOrigin [get]

Font wx.DC.Font [get, set]

Get or set the current font. Notice that even although each device context object has some default font after creation, this method would return a wx.Font.NullFont initially and only after assigning to wx.DC.Font a valid font is returned.

Assignments of null to this property will be ignored.

virtual Logic wx.DC.LogicalFunction [get, set]

Sets the current logical function for the device context. This determines how a source pixel (from a pen or brush colour, or source device context if using wx.DC.Blit) combines with a destination pixel in the current device context.

The possible values and their meaning in terms of source and destination pixel values are as follows:

        /// wxAND                 src AND dst
        /// wxAND_INVERT          (NOT src) AND dst
        /// wxAND_REVERSE         src AND (NOT dst)
        /// wxCLEAR               0
        /// wxCOPY                src
        /// wxEQUIV               (NOT src) XOR dst
        /// wxINVERT              NOT dst
        /// wxNAND                (NOT src) OR (NOT dst)
        /// wxNOR                 (NOT src) AND (NOT dst)
        /// wxNO_OP               dst
        /// wxOR                  src OR dst
        /// wxOR_INVERT           (NOT src) OR dst
        /// wxOR_REVERSE          src OR (NOT dst)
        /// wxSET                 1
        /// wxSRC_INVERT          NOT src
        /// wxXOR                 src XOR dst
        /// 
The default is wxCOPY, which simply draws with the current colour. The others combine the current colour and the background using a logical operation. wxINVERT is commonly used for drawing rubber bands or moving outlines, since drawing twice reverts to the original colour.

Point wx.DC.LogicalOrigin [get]

MappingMode wx.DC.MapMode [get, set]

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 wxDC.SetUserScale) 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.

int wx.DC.MaxX [get]

int wx.DC.MaxY [get]

int wx.DC.MinX [get]

int wx.DC.MinY [get]

virtual bool wx.DC.Ok [get]

Pen wx.DC.Pen [get, set]

Size wx.DC.Size [get]

This gets the horizontal and vertical resolution 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:

              Size s=dc.Size;
              double scaleX=(double)maxX/s.Width;
              double scaleY=(double)maxY/s.Height;
              dc.SetUserScale(min(scaleX,scaleY),min(scaleX,scaleY));

Size wx.DC.SizeMM [get]

Returns the horizontal and vertical resolution in millimetres.

Colour wx.DC.TextBackground [get, set]

Colour wx.DC.TextForeground [get, set]


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads