The Graphics class
The Graphics
class is a wrapper class for a device context. It also provides functionality for drawing lines, rectangles, and ellipses; writing text; saving and restoring graphic states; setting the origin of the device context; and clipping the painting area. The constructor is private since Graphics
objects are intended to be created internally by Small Windows only.
Graphics.h
namespace SmallWindows {
When drawing a line, it can be solid, dashed, dotted, dashed and dotted, as well as dashed and double-dotted:
class Window; enum PenStyle {Solid = PS_SOLID, Dash = PS_DASH, Dot = PS_DOT, DashDot = PS_DASHDOT, DashDotDot =PS_DASHDOTDOT}; class Graphics { private: Graphics(Window* windowPtr, HDC deviceContextHandle);
The Save
method saves the current state of the Graphics
object and Restore
restores it:
public: int Save(); void Restore(int saveId);
The SetOrigin
method...