OVERVIEW
We now look at how to do 2d graphics in wxWidgets. Displaying graphics is different from displaying text – you need something called a Device Context. A Device Context is a software layer which enables your code to interact with the display hardware. It acts as a virtual display on which you draw graphics. The virtual display then translates this onto the actual display hardware. In short a Device Context allows you to do 2d graphics without having to worry about the underlying hardware.
wxWidgets provides functions and classes for interacting with any Device Context. These classes and functions fall under GDI (Graphics Device Interface). GDI consist of three things
- 2d vector graphics
- Fonts
- Images
wxWidgets has a base Device Context called wxDC. But this class is never used directly as it already has predefined subclass like:
- wxBufferedDC
- wxMemoryDC
- wxScreenDC etc.
In the sections ahead we will work with basic GDI functions
Leave a Reply