A SERVICE OF

logo

C H A P T E R
13
Graphics objects
This chapter discusses the ObjectWindows 2.0 encapsulation of the
Windows GDI. ObjectWindows 2.0 makes it easier to use GDI graphics
objects and functions because it simplifies how you create and manipulate
GDI objects. From simple objects such as pens and brushes to more
complex objects such as fonts and bitmaps, the GDI encapsulation of the
ObjectWindows library provides a simple, consistent model for graphical
programming in Windows.
GDI class organization
There are a number of ObjectWindows classes used to encapsulate GDI
functionality Most are derived from the TGdiObject class. TGdiObject.
provides the common functionality for all ObjectWindows GDI classes.
TGdiObject is the abstract base class for ObjectWindows GDI objects. It
provides a base destructor an HGDIOBJ conversion operator and the base, ,
GetObject function. It also provides orphan control for true GDI objects (that
is, objects derived from TGdiObject; other GDI objects, such as TRegion,
TIcon, and TDib, which are derived from TGdiBase, are known as pseudo-
GDI objects).
The other classes in the ObjectWindows GDI encapsulation are:
TDC is the root class for encapsulating ObjectWindows GDI device
contexts. Y u can create a TDC object directly or—for more specializedo
behavior—you can use derived classes.
TP n contains the functionality of Windows pen objects. Y u cane o
construct a pen object from scratch or from an existing pen handle, pen
object, or logical pen (LOGPEN) structure.
TBrush contains the functionality of Windows brush objects. Y u cano
construct a custom brush, creating a solid, styled, or patterned brush, or
you can use an existing brush handle, brush object, or logical brush
(LOGBRUSH) structure.
Chapter 13, Graphics objects
287