TRasterImage class
Base class for a number of graphic controls, including
TCustomBitmap and
TCustomIcon, which use a raster of
dots to display graphic information.
Declaration
TRasterImage = class(TGraphic)Inheritance
- TRasterImage
- TGraphic
- TPersistent
- TObject
Descends from it: TCustomBitmap TCustomIcon
Description
TRasterImage is a
TGraphic descendant which implements
the base class for images displayed as rasterized pixels on a canvas. It is
used as the ancestor class for
TCustomBitmap (
TBitmap)
and
TCustomIcon (
TIcon).
TRasterImage introduces the shared properties and methods common to the image formats. It is also provides a shared, reference-counted image that reduces resource requirements in graphical applications. Support is provided for bitmaps which use DIB (Device-Independent Bitmap) or DDB (Device-Dependent Bitmap) handles as well as common pixel storage formats used in the RawImage data. Handles are provided for the Bitmap, Mask, and Palette resources used in an image. TRasterImage also includes a Canvas used to render the pixels for the image.
Many of the methods in TRasterImage are defined as abstract virtual methods, and must be implemented in a descendent class to provide support for a specific image format.
Properties
Canvas | public | The Canvas where the raster image is rendered. |
BitmapHandle | public | BitmapHandle - the Handle that has been allocated for the Bitmap. |
Masked | public | Masked - returns True if a Mask is being applied. |
MaskHandle | public | The handle allocated for the Bitmap Mask. |
PixelFormat | public | Storage format for the Pixels in the Image. |
RawImage | public | Provides access to the raw image data for the image type. |
ScanLine | public | Provides indexed access to a scan line in the raw image data. |
TransparentColor | public | Color used to represent transparent pixels in the image. |
TransparentMode | public | Determines how transparent pixels are represented in the image. |
Methods
CanShareImage | protected | CanShareImage - returns True if specified class of image can be shared. |
Changed | protected | Changed - method to call when properties have changed. |
CreateDefaultBitmapHandle | protected | Gets the default value for the Bitmap handle used in the class instance. |
Draw | protected | Renders the image to the specified canvas. |
GetEmpty | protected | Gets the value for the Empty property. |
GetHandle | protected | Gets the value for the handle used in the image. |
GetBitmapHandle | protected | Gets the value for the BitmapHandle property. |
GetMasked | protected | Gets the value for the Masked property. |
GetMaskHandle | protected | Gets the value for the MaskHandle property. |
GetMimeType | protected | Gets the value for the MimeType property. |
GetPixelFormat | protected | GetPixelFormat - returns the pixel format for the Image. |
GetRawImagePtr | protected | Gets a pointer with the raw image data. |
GetRawImageDescriptionPtr | protected | Gets a pointer to the metadata for the raw image data. |
GetTransparent | protected | Gets the value for the Transparent property. |
GetSharedImageClass | protected | Gets the class reference used to create new shared image instances in the class. |
GetHeight | protected | Gets the value for the Height property. |
GetWidth | protected | Gets the value for the Width property. |
BitmapHandleNeeded | protected | Ensures that handles for the image and mask are valid for the raw image data. |
HandleNeeded | protected | Ensures that a handle for the image is allocated in widgetset classes. |
MaskHandleNeeded | protected | Ensures that a handle is allocated for the image mask (when needed). |
PaletteNeeded | protected | Ensures that a handle for the palette is allocated. |
InternalReleaseBitmapHandle | protected | InternalReleaseBitmapHandle - releases Bitmap Handle and returns its value. |
InternalReleaseMaskHandle | protected | InternalReleaseMaskHandle - releases Mask Handle and returns its value. |
InternalReleasePalette | protected | InternalReleasePalette - releases Palette Handle and returns its value. |
SetBitmapHandle | protected | Sets the value for the BitmapHandle property. |
SetMasked | protected | Sets the value for the Masked property. |
SetMaskHandle | protected | Sets the value for the MaskHandle property. |
SetTransparent | protected | Sets the value for the Transparent property. |
UnshareImage | protected | Unshares a shared image when its handle is changed or the save stream is freed. |
UpdateHandles | protected | Updates image handles when the raw image data is loaded. |
SaveStreamNeeded | protected | Ensures that the save stream for the shared image is allocated. |
FreeSaveStream | protected | Frees the save stream assigned to the internal shared image. |
ReadData | protected | Reads image data during component streaming. |
ReadStream | protected | ReadStream - loads image data into the raw image. |
SetSize | protected | SetSize - specifies height and width of Image. |
SetHandle | protected | Sets the handle used for the image. |
SetHeight | protected | Sets the value for the Height property. |
SetWidth | protected | Sets the value for the Width property. |
SetTransparentMode | protected | Sets the value for the TransparentMode property. |
SetPixelFormat | protected | Sets the value for the PixelFormat property. |
WriteData | protected | Writes raw image data to the specified stream. |
WriteStream | protected | Writes the image content to the specified stream instance. |
RequestTransparentColor | protected | Gets the color used to represent transparent pixels in the image. |
ApplyTransparent | protected | Applies transparency to an image based on the settings in Transparent, TransparentColor, and TransparentMode. |
Create | public | Constructor for the class instance. |
Destroy | public | Destroy is the destructor for TRasterImage: frees the canvas, and releases image then calls inherited Destroy. |
Assign | public | Assign - copies details from Source according to data type. |
Clear | public | Removes raw image data and frees the internal save stream. |
BeginUpdate | public | BeginUpdate - start the update process. |
EndUpdate | public | EndUpdate - finishes the update process. |
FreeImage | public | Frees the image by resetting its handle. |
BitmapHandleAllocated | public | BitmapHandleAllocated - returns True if a handle has been allocated for the Bitmap. |
MaskHandleAllocated | public | MaskHandleAllocated - returns True if a handle has been allocated for the Mask. |
PaletteAllocated | public | PaletteAllocated - returns True if a Palette has been allocated. |
LoadFromBitmapHandles | public | Loads the image data from the specified Bitmap and Mask handles. |
LoadFromDevice | public | Loads image data from the specified device context. |
LoadFromStream | public | LoadFromStream - loads data for the image from a specified data stream, optionally supplying its size. |
LoadFromMimeStream | public | Loads image data from a stream for the specified MIME type. |
LoadFromRawImage | public | Loads image data from the specified TRawImage instance. |
LoadFromIntfImage | public | Loads the image from a TLazIntfImage instance. |
SaveToStream | public | Saves image data to the specified stream. |
GetSupportedSourceMimeTypes | public | Gets a list of supported MIME types for image data used in the image type. |
GetSize | public | Gets the image Width and Height from the metadata for the raw image. |
Mask | public | Applies the color used for transparent pixels to the image. |
SetHandles | public | Sets handles for the bitmap and the mask to the specified values. |
ReleaseBitmapHandle | public | Releases the handle in the shared image without freeing the BitmapHandle. |
ReleaseMaskHandle | public | ReleaseMaskHandle - releases the Handle used for the Mask. |
ReleasePalette | public | ReleasePalette - release the Handle used for the Palette. |
CreateIntfImage | public | CreateIntfImage - creates an image on the Interface. |
HandleAllocated | public | Indicates if a handle has been assigned for the shared image in the class. |
Fields
FSharedImage | protected | Shared image with existing handles, canvases, etc. |
Inherited
From TGraphic (29)
DefineProperties Empty Equals GetFileExtensions GetPalette GetResourceType Height IsStreamFormatSupported LazarusResourceTypeValid LoadFromClipboardFormat LoadFromClipboardFormatID LoadFromFile LoadFromLazarusResource LoadFromResourceID LoadFromResourceName MimeType Modified OnChange OnProgress Palette PaletteModified Progress SaveToClipboardFormat SaveToClipboardFormatID SaveToFile SetModified SetPalette Transparent Width
From TPersistent (6)
AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers GetNamePath GetOwner
From TObject (39)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
