Home | GR32 |
TBitmap32
Hierarchy
TPersistent
|
|
|
Description
TBitmap32 is the central class in the Graphics32 library. It manages a single 32-bit device-independent bitmap (DIB) and provides methods for drawing on it and combining it with other DIBs or other objects with device context (DC).
TBitmap32 overrides Assign and AssignTo methods (inherited from TPersistent) to provide compatibility with standard objects: TBitmap, TPicture and TClipboard in both directions. The design-time streaming to and from *.dfm files, inherited from TPersistent, is supported, but its realization is different from streaming with other stream types (See the source code for details).
TBitmap32 does not implement its own low-level streaming or low-level file loading/saving. Instead, it uses streaming methods of temporal TBitmap or TPicture objects. This is an obvious performance penalty, however such approach allows using third-party libraries, which extend TGraphic class for various image formats support (JPEG, TGA, TIFF, GIF, PNG, etc.). When you install them, TBitmap32 will automatically obtain support for new image file formats in design time and in run time.
Since TBitmap32 is a descendant of TThreadPersistent, it inherits its locking mechanism and it may be used in multi-threaded applications.
Change Notification
Change notification events (OnCange, OnResize), inherited from TThreadPersistent and TCustomMap are generated by most drawing/resizing etc. functions with a few exceptions. Due to performance considerations the following functions are not accompanied with event generation:
- Pixel-based operations (SetPixelT, SetPixelF...);
- HorzLine* and VertLine* functions;
If necessary, the OnCange event may be generated explicitly by calling the Changed methods.
Normally, if the bitmap is a part of some container (TImage32, TBitmapLayer, etc.), its change notification events are linked to the container, causing repaint operations. When making several simultaneous changes, it may be beneficial to enclose them in BeginUpdate…EndUpdate block followed by the Changed call to reduce the amount of repaintings of the container.
Reference
See Also
BeginUpdate, Changed, EndUpdate, OnChange, TBitmapLayer, TCustomMap, TImage32, TThreadPersistent
Copyright ©2000-2007 Alex Denisov and Contributors - Graphics32 v1.8.3 - Build on 4-March-2007