TCustomBitmap class
TCustomBitmap - the base class for
TBitmap.Declaration
TCustomBitmap = class(TRasterImage)Inheritance
- TCustomBitmap
- TRasterImage
- TGraphic
TPersistent
Descends from it: TFPImageBitmap
Description
TCustomBitmap is a
TRasterImage descendant which
implements the base class for TBitmap. It contains image data using the
.bmp (Windows bitmap) or
.xpm (XPixMap) formats. Image data can
be loaded from a file, stream, or resource. The loading routine automatically
recognizes the format, and can be used to load images from a Delphi form
streams (.dfm files).
When the handle is created, it is up to the widgetset interface (gtk, qt,
win32, etc.) to automatically convert it to the best internal format for the
platform. That is the reason the Handle is interface dependent. To access the
raw image data, see TLazIntfImage in IntfGraphics.pas.
Do not create instances of TCustomBitmap; use the TBitmap descendant.
Properties
Handle | public | The operating system Handle associated with this bitmap. |
HandleType | public | Handle type for the Bitmap. |
Monochrome | public | True when the image contains monochrome image data. |
Methods
MaskHandleNeeded | protected | Ensures that a handle is allocated for the image mask (when needed). |
PaletteNeeded | protected | Ensures that a handle is allocated for the Palette in the image. |
CanShareImage | protected | Indicates if the image uses the specified shared image class. |
Changed | protected | Performs actions needed when the image data for the bitmap has been changed. |
CreateDefaultBitmapHandle | protected | Creates a handle for the bitmap using the bitmap handle type in the bitmap image data. |
FreeMaskHandle | protected | FreeMaskHandle - method to release Mask handle. |
GetBitmapHandle | protected | Gets the value for the Handle property. |
GetMaskHandle | protected | Gets the value for the MaskHandle property. |
GetPalette | protected | Gets the value for the Palette property. |
GetPixelFormat | protected | Gets the value for the PixelFormat property. |
GetRawImagePtr | protected | Gets a pointer with the raw image data. |
GetRawImageDescriptionPtr | protected | Gets a pointer to the image descriptor for the shared Bitmap image. |
GetSharedImageClass | protected | Gets the class reference used to create new shared image instances in the class. |
HandleNeeded | protected | Ensures that the handle for the bitmap has been assigned. |
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. |
RawimageNeeded | protected | Ensures that the RawImage data is allocated prior to use. |
SetHandle | protected | Re-implements the method from the ancestor class. |
SetPixelFormat | protected | Sets the value for the PixelFormat property. |
UnshareImage | protected | Frees the shared image in the bitmap, and creates a new one. |
UpdateHandles | protected | Sets the handles for the image and mask in the shared Bitmap to the specified values. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
Assign | public | Copies values from the specified persistent object into the class instance. |
Clear | public | Clears the content for the bitmap image. |
FreeImage | public | Releases the resources for the image when it is discarded. |
LazarusResourceTypeValid | public | Determines if the specified resource type is valid for the image format. |
BitmapHandleAllocated | public | Returns True if a handle has been allocated for the Bitmap. |
MaskHandleAllocated | public | Determines if the mask handle has been allocated for the image. |
PaletteAllocated | public | Indicates whether a handle has been allocated for a palette in the image. |
ReleaseHandle | public | Releases the bitmap handle for the shared image. |
SetHandles | public | Sets handles for the bitmap and the mask to the specified values. |
SetSize | public | Sets the Height and Width for the image to the specified values. |
Inherited
From TRasterImage (50)
ApplyTransparent BeginUpdate BitmapHandle BitmapHandleNeeded Canvas CreateIntfImage Draw EndUpdate FreeSaveStream GetEmpty GetHandle GetHeight GetMasked GetMimeType GetSize GetSupportedSourceMimeTypes GetTransparent GetWidth HandleAllocated LoadFromBitmapHandles LoadFromDevice LoadFromIntfImage LoadFromMimeStream LoadFromRawImage LoadFromStream Mask Masked MaskHandle PixelFormat RawImage ReadData ReadStream ReleaseBitmapHandle ReleaseMaskHandle ReleasePalette RequestTransparentColor SaveStreamNeeded SaveToStream ScanLine SetBitmapHandle SetHeight SetMasked SetMaskHandle SetTransparent SetTransparentMode SetWidth TransparentColor TransparentMode WriteData WriteStream
From TGraphic (27)
DefineProperties Empty Equals GetFileExtensions GetResourceType Height IsStreamFormatSupported LoadFromClipboardFormat LoadFromClipboardFormatID LoadFromFile LoadFromLazarusResource LoadFromResourceID LoadFromResourceName MimeType Modified OnChange OnProgress Palette PaletteModified Progress SaveToClipboardFormat SaveToClipboardFormatID SaveToFile SetModified SetPalette Transparent Width
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
