Description:
The wxDC class in wxWidgets provides a device context for drawing various shapes and text onto a wxWindow. One of its member functions, GetCharHeight(), retrieves the height of an average character in the current font of the device context.
Code Examples:
Here are a few simple examples demonstrating the usage of the GetCharHeight() function in wxWidgets:
1. Retrieving the character height of a wxDC object:
```c++
wxDC* dc = new wxPrinterDC(printer);
int charHeight = dc->GetCharHeight();
delete dc;
```
In this example, we create a new wxPrinterDC object to represent a printer device context. We then use GetCharHeight() to retrieve the average character height of the current font set on this device context.
Package Library:
wxWidgets is an open-source cross-platform GUI library that provides a native look and feel on various operating systems. GetCharHeight() is a member function of the wxDC class, which is part of the core wxWidgets library.
C++ (Cpp) wxDC::GetCharHeight - 18 examples found. These are the top rated real world C++ (Cpp) examples of wxDC::GetCharHeight extracted from open source projects. You can rate examples to help us improve the quality of examples.