Base Framework
Classes | Public Types | Public Member Functions | List of all members
GraphicsContext Class Reference

Graphics context. More...

#include <base/ui/GraphicsContext.h>

Inherits WindowImpl.

Inherited by Pixmap, PopUpWindow, Widget, and Window.

Classes

class  Alignment
 
class  Brush
 Handle to a brush. More...
 
class  Font
 Handle to a font. More...
 
class  GraphicsContextObject
 Handle to a graphics context object (e.g. pen, brush, and font). More...
 
class  GraphicsContextObjectHandle
 
class  Pen
 Handle to a pen. More...
 
class  TextFormat
 

Public Types

enum  SystemColor {
  WINDOW_BACKGROUND, WINDOW_FRAME, WINDOW_TEXT, MENU,
  MENU_TEXT, BUTTON_TEXT, DISABLED_TEXT, HIGHLIGHTED_TEXT
}
 
enum  PenStyle {
  NONE, SOLID, DASH, DOT,
  DASH_DOT, DASH_DOT_DOT
}
 
enum  FontFlags { ITALIC = 1, UNDERLINE = 2, STRIKE_OUT = 4 }
 
enum  FontWeight {
  THIN, LIGHT, NORMAL, BOLD,
  HEAVY
}
 
enum  GraphicsFlag { FILLED = 1 }
 
- Public Types inherited from WindowImpl
enum  DisplayMode {
  MODE_WINDOW, MODE_FULL_SCREEN, MODE_WINDOW, MODE_FULL_SCREEN,
  MODE_WINDOW, MODE_FULL_SCREEN
}
 
enum  Cursor {
  INHERIT, NONE, WORKING_IN_BACKGROUND, ARROW,
  CROSSHAIR, HAND, HELP, NO,
  MOVING, NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST,
  WEST_EAST, VERTICAL_ARROW, WAITING, INHERIT,
  NONE, WORKING_IN_BACKGROUND, ARROW, CROSSHAIR,
  HAND, HELP, NO, MOVING,
  NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST,
  VERTICAL_ARROW, WAITING, INHERIT, NONE,
  WORKING_IN_BACKGROUND, ARROW, CROSSHAIR, HAND,
  HELP, NO, MOVING, NORTHEAST_SOUTHWEST,
  NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST, VERTICAL_ARROW,
  WAITING
}
 
enum  Visibility {
  INVISIBLE, OBSCURED, VISIBLE, INVISIBLE,
  OBSCURED, VISIBLE, INVISIBLE, OBSCURED,
  VISIBLE
}
 
enum  Flag {
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1, AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1,
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1
}
 
enum  Focus {
  LOST_FOCUS, ACQUIRED_FOCUS, LOST_FOCUS, ACQUIRED_FOCUS,
  LOST_FOCUS, ACQUIRED_FOCUS
}
 
enum  Binding {
  UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT, MIDDLE_LEFT,
  MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT, LOWER_CENTER,
  LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT,
  MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT,
  LOWER_CENTER, LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER,
  UPPER_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT,
  LOWER_LEFT, LOWER_CENTER, LOWER_RIGHT
}
 
enum  DisplayMode {
  MODE_WINDOW, MODE_FULL_SCREEN, MODE_WINDOW, MODE_FULL_SCREEN,
  MODE_WINDOW, MODE_FULL_SCREEN
}
 
enum  Cursor {
  INHERIT, NONE, WORKING_IN_BACKGROUND, ARROW,
  CROSSHAIR, HAND, HELP, NO,
  MOVING, NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST,
  WEST_EAST, VERTICAL_ARROW, WAITING, INHERIT,
  NONE, WORKING_IN_BACKGROUND, ARROW, CROSSHAIR,
  HAND, HELP, NO, MOVING,
  NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST,
  VERTICAL_ARROW, WAITING, INHERIT, NONE,
  WORKING_IN_BACKGROUND, ARROW, CROSSHAIR, HAND,
  HELP, NO, MOVING, NORTHEAST_SOUTHWEST,
  NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST, VERTICAL_ARROW,
  WAITING
}
 
enum  Visibility {
  INVISIBLE, OBSCURED, VISIBLE, INVISIBLE,
  OBSCURED, VISIBLE, INVISIBLE, OBSCURED,
  VISIBLE
}
 
enum  Flag {
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1, AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1,
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1
}
 
enum  Focus {
  LOST_FOCUS, ACQUIRED_FOCUS, LOST_FOCUS, ACQUIRED_FOCUS,
  LOST_FOCUS, ACQUIRED_FOCUS
}
 
enum  Binding {
  UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT, MIDDLE_LEFT,
  MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT, LOWER_CENTER,
  LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT,
  MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT,
  LOWER_CENTER, LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER,
  UPPER_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT,
  LOWER_LEFT, LOWER_CENTER, LOWER_RIGHT
}
 
enum  DisplayMode {
  MODE_WINDOW, MODE_FULL_SCREEN, MODE_WINDOW, MODE_FULL_SCREEN,
  MODE_WINDOW, MODE_FULL_SCREEN
}
 
enum  Cursor {
  INHERIT, NONE, WORKING_IN_BACKGROUND, ARROW,
  CROSSHAIR, HAND, HELP, NO,
  MOVING, NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST,
  WEST_EAST, VERTICAL_ARROW, WAITING, INHERIT,
  NONE, WORKING_IN_BACKGROUND, ARROW, CROSSHAIR,
  HAND, HELP, NO, MOVING,
  NORTHEAST_SOUTHWEST, NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST,
  VERTICAL_ARROW, WAITING, INHERIT, NONE,
  WORKING_IN_BACKGROUND, ARROW, CROSSHAIR, HAND,
  HELP, NO, MOVING, NORTHEAST_SOUTHWEST,
  NORTH_SOUTH, NORTHWEST_SOUTHEAST, WEST_EAST, VERTICAL_ARROW,
  WAITING
}
 
enum  Visibility {
  INVISIBLE, OBSCURED, VISIBLE, INVISIBLE,
  OBSCURED, VISIBLE, INVISIBLE, OBSCURED,
  VISIBLE
}
 
enum  Flag {
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1, AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1,
  AUTO_CLEAR = 1 << 0, FIXED_SIZE = 1 << 1
}
 
enum  Focus {
  LOST_FOCUS, ACQUIRED_FOCUS, LOST_FOCUS, ACQUIRED_FOCUS,
  LOST_FOCUS, ACQUIRED_FOCUS
}
 
enum  Binding {
  UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT, MIDDLE_LEFT,
  MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT, LOWER_CENTER,
  LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER, UPPER_RIGHT,
  MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, LOWER_LEFT,
  LOWER_CENTER, LOWER_RIGHT, UPPER_LEFT, UPPER_CENTER,
  UPPER_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT,
  LOWER_LEFT, LOWER_CENTER, LOWER_RIGHT
}
 

Public Member Functions

 GraphicsContext ()
 
 GraphicsContext (const Position &position, const Dimension &dimension, unsigned int flags)
 
const PengetPen () const noexcept
 
void setPen (Pen pen)
 
const BrushgetBrush () const noexcept
 
void setBrush (Brush brush)
 
const FontgetFont () const noexcept
 
void setFont (Font font)
 
void setBackgroundMode (bool transparent)
 
void setBackgroundColor (Color color)
 
void setTextColor (Color color)
 
void setTextAlignment (unsigned int alignment)
 
void clear ()
 
void clear (const Position &position, const Dimension &dimension)
 
void setPixel (const Position &position, Color color, unsigned int flags=0)
 
Color getPixel (const Position &position)
 
void setPixels (const Array< Position > &positions, Color color, unsigned int flags=0)
 
void moveTo (const Position &position)
 
void lineTo (const Position &position, unsigned int flags=0)
 
void line (const Position &upperLeft, const Position &lowerRight, unsigned int flags=0)
 
void arc (const Position &position, const Dimension &dimension, int start, int stop, unsigned int flags=0)
 
void rectangle (const Position &upperLeft, const Position &b, unsigned int flags=0)
 
void rectangle (const Position &position, const Dimension &dimension, unsigned int flags=0)
 
void rectangle (const Position &upperLeft, const Position &lowerRight, Brush brush, unsigned int flags=0)
 
void rectangle (const Position &position, const Dimension &dimension, Brush brush, unsigned int flags=0)
 
void ellipse (const Position &upperLeft, const Position &lowerRight, unsigned int flags=0)
 
void ellipse (const Position &position, const Dimension &dimension, unsigned int flags=0)
 
void circle (const Position &position, unsigned int dimension, unsigned int flags=0)
 
void pie (const Position &upperLeft, const Position &lowerRight, const Position &radialA, const Position &radialB, unsigned int flags)
 
unsigned int getWidthOf (char ch) const
 
Dimension getDimensionOf (const String &text) const
 
void text (const Position &position, const Dimension &dimension, const String &text, unsigned int flags=0)
 
void putBitmap (const Position &position, const Dimension &dimension, const Bitmap &bitmap)
 
Bitmap getBitmap (const Position &position, const Dimension &dimension)
 
 ~GraphicsContext () noexcept
 
- Public Member Functions inherited from WindowImpl
 WindowImpl ()
 
 WindowImpl (const Position &position, const Dimension &dimension, unsigned int flags)
 
Position getBindingOffset (Binding binding) const noexcept
 
void flush ()
 
void invalidate ()
 
String getServerVendor () const
 
unsigned int getServerRelease () const
 
unsigned int getFlags () const
 
void displayMenu (const Position &position, const Menu &menu)
 
bool getAutorepeat () const
 
void setAutorepeat (bool autorepeat)
 
String getTitle () const
 
void setTitle (const String &title)
 
String getIconTitle () const
 
void setIconTitle (const String &title)
 
Position getPosition () const
 
void setPosition (const Position &position)
 
Dimension getDimension () const
 
void setDimension (const Dimension &dimension)
 
void setRegion (const Position &position, const Dimension &dimension)
 
void setMinimumSize (const Dimension &dimension)
 
void setMaximumSize (const Dimension &dimension)
 
Cursor getCursor () const noexcept
 
void setCursor (Cursor cursor)
 
Position toGlobalPosition (const Position &position) const
 
Position getCursorPosition () const
 
void setCursorPosition (const Position &position)
 
void releaseCursorConfinement ()
 
void setCursorConfinement ()
 
void setCursorConfinement (const Position &position, const Dimension &dimension)
 
void disableClipping ()
 
Region getClipping () const
 
void setClipping (const Position &position, const Dimension &dimension)
 
void close ()
 
bool isChildOf (const WindowImpl &object)
 
bool isParentOf (const WindowImpl &object)
 
bool isMaximized ()
 
bool isMinimized ()
 
void maximize ()
 
void minimize ()
 
void normalize ()
 
bool isVisible () const noexcept
 
Visibility getVisibility () const noexcept
 
void show ()
 
void hide ()
 
bool isEnabled () const noexcept
 
void enable ()
 
void disable ()
 
void raise ()
 
void acquireFocus ()
 
bool getCapture () const
 
void setCapture (bool state)
 
DisplayMode getDisplayMode () const
 
void setDisplayMode (DisplayMode displayMode)
 
unsigned int getKeyState (unsigned int code) const
 
unsigned int getModifiers () const
 
virtual void onDestruction () noexcept
 
virtual void onDisplay () noexcept
 
virtual void onMove (const Position &position) noexcept
 
virtual void onResize (const Dimension &dimension) noexcept
 
virtual void onMouseMove (const Position &position, unsigned int buttons) noexcept
 
virtual void onMouseScope (bool scope) noexcept
 
virtual void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
virtual void onMouseWheel (const Position &position, int delta, unsigned int buttons) noexcept
 
virtual void onKey (unsigned int key, unsigned int flags, unsigned int modifiers) noexcept
 
virtual void onIdle () noexcept
 
virtual bool onClose () noexcept
 
virtual void onVisibility (Visibility visibility) noexcept
 
virtual void onFocus (Focus focus) noexcept
 
virtual void onMenu (unsigned int identifier) noexcept
 
virtual void onCommand (unsigned int identifier) noexcept
 
void update ()
 
void wait ()
 
bool wait (unsigned int milliseconds)
 
bool openDispatch ()
 
bool hasMouse () noexcept
 
unsigned int getMouseButtons () noexcept
 
unsigned int getNumberOfMonitors () noexcept
 
Dimension getDisplayDimension () noexcept
 
bool isResponding (unsigned int milliseconds)
 
virtual ~WindowImpl () noexcept
 
 WindowImpl ()
 
 WindowImpl (const Position &position, const Dimension &dimension, unsigned int flags)
 
Position getBindingOffset (Binding binding) const noexcept
 
void flush ()
 
void invalidate ()
 
String getServerVendor () const
 
unsigned int getServerRelease () const
 
unsigned int getFlags () const
 
void displayMenu (const Position &position, const Menu &menu)
 
bool getAutorepeat () const
 
void setAutorepeat (bool autorepeat)
 
String getTitle () const
 
void setTitle (const String &title)
 
String getIconTitle () const
 
void setIconTitle (const String &title)
 
Position getPosition () const
 
void setPosition (const Position &position)
 
Dimension getDimension () const
 
void setDimension (const Dimension &dimension)
 
void setRegion (const Position &position, const Dimension &dimension)
 
void setMinimumSize (const Dimension &dimension)
 
void setMaximumSize (const Dimension &dimension)
 
Cursor getCursor () const noexcept
 
void setCursor (Cursor cursor)
 
Position toGlobalPosition (const Position &position) const
 
Position getCursorPosition () const
 
void setCursorPosition (const Position &position)
 
void releaseCursorConfinement ()
 
void setCursorConfinement ()
 
void setCursorConfinement (const Position &position, const Dimension &dimension)
 
void disableClipping ()
 
Region getClipping () const
 
void setClipping (const Position &position, const Dimension &dimension)
 
void close ()
 
bool isChildOf (const WindowImpl &object)
 
bool isParentOf (const WindowImpl &object)
 
bool isMaximized ()
 
bool isMinimized ()
 
void maximize ()
 
void minimize ()
 
void normalize ()
 
bool isVisible () const noexcept
 
Visibility getVisibility () const noexcept
 
void show ()
 
void hide ()
 
bool isEnabled () const noexcept
 
void enable ()
 
void disable ()
 
void raise ()
 
void acquireFocus ()
 
bool getCapture () const
 
void setCapture (bool state)
 
DisplayMode getDisplayMode () const
 
void setDisplayMode (DisplayMode displayMode)
 
unsigned int getKeyState (unsigned int code) const
 
unsigned int getModifiers () const
 
virtual void onDestruction () noexcept
 
virtual void onDisplay () noexcept
 
virtual void onMove (const Position &position) noexcept
 
virtual void onResize (const Dimension &dimension) noexcept
 
virtual void onMouseMove (const Position &position, unsigned int buttons) noexcept
 
virtual void onMouseScope (bool scope) noexcept
 
virtual void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
virtual void onMouseWheel (const Position &position, int delta, unsigned int buttons) noexcept
 
virtual void onKey (unsigned int key, unsigned int flags, unsigned int modifiers) noexcept
 
virtual void onIdle () noexcept
 
virtual bool onClose () noexcept
 
virtual void onVisibility (Visibility visibility) noexcept
 
virtual void onFocus (Focus focus) noexcept
 
virtual void onMenu (unsigned int identifier) noexcept
 
virtual void onCommand (unsigned int identifier) noexcept
 
void update ()
 
void wait ()
 
bool wait (unsigned int milliseconds)
 
bool openDispatch ()
 
bool hasMouse () noexcept
 
unsigned int getMouseButtons () noexcept
 
unsigned int getNumberOfMonitors () noexcept
 
Dimension getDisplayDimension () noexcept
 
bool isResponding (unsigned int milliseconds)
 
virtual ~WindowImpl () noexcept
 
 WindowImpl ()
 
 WindowImpl (const Position &position, const Dimension &dimension, unsigned int flags)
 
Position getLocalBindingOffset (Binding binding) const noexcept
 
Position getBindingOffset (Binding binding) const noexcept
 
void flush ()
 
void invalidate ()
 
String getServerVendor () const
 
unsigned int getServerRelease () const
 
unsigned int getFlags () const
 
void displayMenu (const Position &position, const Menu &menu)
 
bool getAutorepeat () const
 
void setAutorepeat (bool autorepeat)
 
String getTitle () const
 
void setTitle (const String &title)
 
String getIconTitle () const
 
void setIconTitle (const String &title)
 
Position getPosition () const
 
void setPosition (const Position &position)
 
Dimension getDimension () const
 
void setDimension (const Dimension &dimension)
 
void setRegion (const Position &position, const Dimension &dimension)
 
void setMinimumSize (const Dimension &dimension)
 
void setMaximumSize (const Dimension &dimension)
 
Cursor getCursor () const noexcept
 
void setCursor (Cursor cursor)
 
Position toGlobalPosition (const Position &position) const
 
Position getCursorPosition () const
 
void setCursorPosition (const Position &position)
 
void releaseCursorConfinement ()
 
void setCursorConfinement ()
 
void setCursorConfinement (const Position &position, const Dimension &dimension)
 
void disableClipping ()
 
Region getClipping () const
 
void setClipping (const Position &position, const Dimension &dimension)
 
void close ()
 
bool isChildOf (const WindowImpl &object)
 
bool isParentOf (const WindowImpl &object)
 
bool isMaximized ()
 
bool isMinimized ()
 
void maximize ()
 
void minimize ()
 
void normalize ()
 
bool isVisible () const noexcept
 
Visibility getVisibility () const noexcept
 
void show ()
 
void hide ()
 
bool isEnabled () const noexcept
 
void enable ()
 
void disable ()
 
void raise ()
 
void acquireFocus ()
 
bool getCapture () const
 
void setCapture (bool state)
 
DisplayMode getDisplayMode () const
 
void setDisplayMode (DisplayMode displayMode)
 
unsigned int getKeyState (unsigned int code) const
 
unsigned int getModifiers () const
 
virtual void onDestruction () noexcept
 
virtual void onDisplay () noexcept
 
virtual void onMove (const Position &position) noexcept
 
virtual void onResize (const Dimension &dimension) noexcept
 
virtual void onMouseMove (const Position &position, unsigned int buttons) noexcept
 
virtual void onMouseScope (bool scope) noexcept
 
virtual void onMouseButton (const Position &position, Mouse::Button button, Mouse::Event event, unsigned int state) noexcept
 
virtual void onMouseWheel (const Position &position, int delta, unsigned int buttons) noexcept
 
virtual void onKey (unsigned int key, unsigned int flags, unsigned int modifiers) noexcept
 
virtual void onIdle () noexcept
 
virtual bool onClose () noexcept
 
virtual void onVisibility (Visibility visibility) noexcept
 
virtual void onFocus (Focus focus) noexcept
 
virtual void onMenu (unsigned int identifier) noexcept
 
virtual void onCommand (unsigned int identifier) noexcept
 
void update ()
 
void wait ()
 
bool wait (unsigned int milliseconds)
 
bool openDispatch ()
 
bool hasMouse () noexcept
 
unsigned int getMouseButtons () noexcept
 
unsigned int getNumberOfMonitors () noexcept
 
Dimension getDisplayDimension () noexcept
 
bool isResponding (unsigned int milliseconds)
 
virtual ~WindowImpl () noexcept
 

Additional Inherited Members

- Static Public Member Functions inherited from WindowImpl
static unsigned int getMouseButtonIndex (Mouse::Button button) noexcept
 
static Literal getMouseButtonName (Mouse::Button button) noexcept
 
static void exit () noexcept
 
static void dispatch ()
 
static unsigned int getMouseButtonIndex (Mouse::Button button) noexcept
 
static Literal getMouseButtonName (Mouse::Button button) noexcept
 
static void exit () noexcept
 
static void dispatch ()
 
static unsigned int getMouseButtonIndex (Mouse::Button button) noexcept
 
static Literal getMouseButtonName (Mouse::Button button) noexcept
 
static void exit () noexcept
 
static void dispatch ()
 
- Protected Member Functions inherited from WindowImpl
void construct () noexcept
 
virtual void destroy () noexcept
 
void construct () noexcept
 
virtual void destroy () noexcept
 
void construct () noexcept
 
virtual void destroy () noexcept
 
- Protected Attributes inherited from WindowImpl
String title
 
String iconTitle
 
Position position
 
Dimension dimension
 
unsigned int flags = 0
 
Dimension minimumSize
 
Dimension maximumSize
 
void * screenHandle = nullptr
 
void * graphicsContextHandle = nullptr
 
- Protected Attributes inherited from Drawable
void * drawableHandle = nullptr
 
- Static Protected Attributes inherited from WindowImpl
static void * displayHandle
 

Detailed Description

Graphics context.

Graphics context.

Version
1.0

Member Enumeration Documentation

◆ FontFlags

Font flag.

Enumerator
ITALIC 

Italic.

UNDERLINE 

Underline.

STRIKE_OUT 

Strike out.

◆ FontWeight

Font weight.

Enumerator
THIN 

Thin.

LIGHT 

Light.

NORMAL 

Normal.

BOLD 

Bold.

HEAVY 

Heavy.

◆ PenStyle

Pen style.

Enumerator
NONE 

None.

SOLID 

Solid.

DASH 

Dash.

DOT 

Dot.

DASH_DOT 

Dash dot.

DASH_DOT_DOT 

Dash dot dot.

◆ SystemColor

System color.

Constructor & Destructor Documentation

◆ GraphicsContext() [1/2]

GraphicsContext::GraphicsContext ( )
inline

Initializes the graphics context.

◆ GraphicsContext() [2/2]

GraphicsContext::GraphicsContext ( const Position position,
const Dimension dimension,
unsigned int  flags 
)
inline

Initializes the graphics context.

◆ ~GraphicsContext()

GraphicsContext::~GraphicsContext ( )
noexcept

Destroys the graphics context.

Member Function Documentation

◆ arc()

void GraphicsContext::arc ( const Position position,
const Dimension dimension,
int  start,
int  stop,
unsigned int  flags = 0 
)

Draws an arc.

Parameters
flagsThe flags.

◆ circle()

void GraphicsContext::circle ( const Position position,
unsigned int  dimension,
unsigned int  flags = 0 
)
inline

Draws a circle specified by the bounding rectangle using the current pen and brush.

Parameters
positionThe upper left of the corner.
dimensionThe dimension of the rectangle.
flagsThe flags.

◆ clear() [1/2]

void GraphicsContext::clear ( )

Clears the window.

◆ clear() [2/2]

void GraphicsContext::clear ( const Position position,
const Dimension dimension 
)

Clear the specified region.

◆ ellipse() [1/2]

void GraphicsContext::ellipse ( const Position position,
const Dimension dimension,
unsigned int  flags = 0 
)

Draws an ellipse specified by the bounding rectangle using the current pen and brush.

Parameters
positionThe upper left of the corner.
dimensionThe dimension of the rectangle.
flagsThe flags.

◆ ellipse() [2/2]

void GraphicsContext::ellipse ( const Position upperLeft,
const Position lowerRight,
unsigned int  flags = 0 
)

Draws an ellipse specified by the bounding rectangle using the current pen and brush.

Parameters
upperLeftThe upper left corner.
lowerRightThe lower right corner.
flagsThe flags.

◆ getBitmap()

Bitmap GraphicsContext::getBitmap ( const Position position,
const Dimension dimension 
)

Extracts the specified region as a bitmap.

Parameters
positionThe upper left of the corner.
dimensionThe dimension of the rectangle.

◆ getBrush()

const Brush& GraphicsContext::getBrush ( ) const
inlinenoexcept

Returns the current brush.

◆ getDimensionOf()

Dimension GraphicsContext::getDimensionOf ( const String text) const

Returns the dimension of the text.

◆ getFont()

const Font& GraphicsContext::getFont ( ) const
inlinenoexcept

Returns the current font.

◆ getPen()

const Pen& GraphicsContext::getPen ( ) const
inlinenoexcept

Returns the current pen.

◆ getPixel()

Color GraphicsContext::getPixel ( const Position position)

Returns the color of the pixel at the specified position.

Parameters
positionThe position of the pixel.

◆ getWidthOf()

unsigned int GraphicsContext::getWidthOf ( char  ch) const

Returns the width of the specified character.

◆ line()

void GraphicsContext::line ( const Position upperLeft,
const Position lowerRight,
unsigned int  flags = 0 
)

Draws a line using the current pen.

Parameters
upperLeftThe upper left corner.
lowerRightThe lower right corner.
flagsThe flags.

◆ lineTo()

void GraphicsContext::lineTo ( const Position position,
unsigned int  flags = 0 
)

Draws a line from the current position to the specified position using the current pen.

Parameters
positionThe position.
flagsThe flags.

◆ moveTo()

void GraphicsContext::moveTo ( const Position position)

Sets the current position.

Parameters
positionThe position.

◆ pie()

void GraphicsContext::pie ( const Position upperLeft,
const Position lowerRight,
const Position radialA,
const Position radialB,
unsigned int  flags 
)

Draw a pie.

Parameters
upperLeftThe upper left corner of the bounding rectangle.
lowerRightThe lower right corner of the bounding rectangle.
radialAEnd point of first radial.
radialBEnd point of second radial.
flagsThe flags.

◆ putBitmap()

void GraphicsContext::putBitmap ( const Position position,
const Dimension dimension,
const Bitmap bitmap 
)

Draws the specified image.

Parameters
positionThe upper left of the corner.
dimensionThe dimension of the rectangle.

◆ rectangle() [1/4]

void GraphicsContext::rectangle ( const Position position,
const Dimension dimension,
Brush  brush,
unsigned int  flags = 0 
)

Draws a rectangle with the specified brush.

Parameters
positionThe upper left corner.
dimensionThe dimension of the rectangle.
brushThe brush used to fill the rectangle.
flagsThe flags.

◆ rectangle() [2/4]

void GraphicsContext::rectangle ( const Position position,
const Dimension dimension,
unsigned int  flags = 0 
)

Draws a rectangle using the current pen and brush.

Parameters
positionThe upper left corner.
dimensionThe dimension of the rectangle.
flagsThe flags.

◆ rectangle() [3/4]

void GraphicsContext::rectangle ( const Position upperLeft,
const Position b,
unsigned int  flags = 0 
)

Draws a rectangle using the current pen and brush.

Parameters
upperLeftThe upper left corner.
lowerRightThe lower right corner.
flagsThe flags.

◆ rectangle() [4/4]

void GraphicsContext::rectangle ( const Position upperLeft,
const Position lowerRight,
Brush  brush,
unsigned int  flags = 0 
)

Draws a rectangle with the specified brush.

Parameters
upperLeftThe upper left corner.
lowerRightThe lower right corner.
brushThe brush used to fill the rectangle.
flagsThe flags.

◆ setBackgroundColor()

void GraphicsContext::setBackgroundColor ( Color  color)

Sets the background color.

◆ setBackgroundMode()

void GraphicsContext::setBackgroundMode ( bool  transparent)

Sets the background mode.

◆ setBrush()

void GraphicsContext::setBrush ( Brush  brush)

Sets the brush.

◆ setFont()

void GraphicsContext::setFont ( Font  font)

Sets the font.

◆ setPen()

void GraphicsContext::setPen ( Pen  pen)

Sets the pen.

◆ setPixel()

void GraphicsContext::setPixel ( const Position position,
Color  color,
unsigned int  flags = 0 
)

Draws a point.

Parameters
positionThe position of the point.
colorThe desired color.
flagsThe flags.

◆ setPixels()

void GraphicsContext::setPixels ( const Array< Position > &  positions,
Color  color,
unsigned int  flags = 0 
)

Draws a point.

Parameters
positionsThe positions of the points.
colorThe desired color.
flagsThe flags.

◆ setTextAlignment()

void GraphicsContext::setTextAlignment ( unsigned int  alignment)

Sets the text alignment.

◆ setTextColor()

void GraphicsContext::setTextColor ( Color  color)

Sets the text color.

◆ text()

void GraphicsContext::text ( const Position position,
const Dimension dimension,
const String text,
unsigned int  flags = 0 
)

Draws text.

Parameters
positionThe upper left of the corner.
dimensionThe dimension of the rectangle.
flagsThe flags.