Public Member Functions | |
Canvas & | getCanvas () |
Returns the Canvas the pen belongs to. | |
HPEN | getPenHandle () |
Returns the Handle to the pen. | |
Pen (Canvas &canvas, COLORREF color, int width=0) | |
Constructor taking a Canvas, a COLORREF, and optionally a width. | |
~Pen () | |
Automatically resets the pen back to the former pen and frees the given pen. |
Constructor takes a COLORREF which can be obtained by using e.g. the RGB macro.
Class ensures that when finished with your pen your pen is released and the former one is reactivated.
Automatically resets back to the former used pen when object is destroyed.
The hdc parameter to the Constructor is the Device Context you wish to create the pen in.
Related classes
Constructor taking a Canvas, a COLORREF, and optionally a width.
Build a COLORREF argument with windows.h's RGB( red, green, blue ). The optional width is the width in pixels of the line drawn by the pen.
~Pen | ( | ) |
Canvas & getCanvas | ( | ) |
HPEN getPenHandle | ( | ) |
Returns the Handle to the pen.
Returns the Handle to the pen