class provides a series of drawing functions that
correspond to Windows GDI drawing functions. Basic
functions include those that draw various (straight and curved)
lines and those that draw shapes.
drawing functions make use of the concept of the current
position in the device context. The current position is a
pair of coordinates that usually represents the endpoint
of the last drawing operation. The current position can be
set using the MoveTo member function and can be retrieved
using the GetCurrentPosition member function.
functions use the current pen for drawing the line. To
draw a straight line, use the MoveTo and
functions. To draw an elliptical arc, use the Arc or
functions. The direction of the arc can be controlled
using the SetArcDirection member function; (use
GetArcDirection to retrieve the current setting).
and PolylineTo functions can be used to draw a series of
connected line segments;
PolyPolyline is a function to
draw several polylines in a single operation. Windows can
also draw BŽzier curves; use the
PolyBezierTo member functions. Finally, a series of line
segments and BŽzier curves can be drawn in a single
operation using PolyDraw.
functions include Rectangle, RoundRect, Ellipse, Chord,
Pie, and Polygon. The shapes generated by these functions
are shown in Figure 4. One additional function,
PolyPolygon, enables the drawing of multiple polygons in a
4. Some basic shapes.
function draws a region using the current brush. The
DrawFocusRect function is used to draw a rectangle around
an object to indicate that the object has the focus. The
focus rectangle is drawn using the exclusive OR logical
function, so calling DrawFocusRect for the second time
effectively removes the focus rectangle. Note that if you
scroll an area containing a focus rectangle, it is
necessary to remove the focus rectangle first, scroll the
area, and then redraw the focus rectangle.
UCanCode Advance E-XD++
CAD Drawing and Printing Solution
Source Code Solution for C/C++, .NET V2014 is released!
Contact UCanCode Software
To buy the source code or learn more about with: