Sign in Join
FPDoc Onlineexperiment

TCustomBitmap class

In unit Graphics

TCustomBitmap - the base class for TBitmap.

Declaration

pascal
TCustomBitmap = class(TRasterImage)

Inheritance

  1. TCustomBitmap
  2. TRasterImage
  3. TGraphic
  4. 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

HandlepublicThe operating system Handle associated with this bitmap.
HandleTypepublicHandle type for the Bitmap.
MonochromepublicTrue when the image contains monochrome image data.

Methods

MaskHandleNeededprotectedEnsures that a handle is allocated for the image mask (when needed).
PaletteNeededprotectedEnsures that a handle is allocated for the Palette in the image.
CanShareImageprotectedIndicates if the image uses the specified shared image class.
ChangedprotectedPerforms actions needed when the image data for the bitmap has been changed.
CreateDefaultBitmapHandleprotectedCreates a handle for the bitmap using the bitmap handle type in the bitmap image data.
FreeMaskHandleprotectedFreeMaskHandle - method to release Mask handle.
GetBitmapHandleprotectedGets the value for the Handle property.
GetMaskHandleprotectedGets the value for the MaskHandle property.
GetPaletteprotectedGets the value for the Palette property.
GetPixelFormatprotectedGets the value for the PixelFormat property.
GetRawImagePtrprotectedGets a pointer with the raw image data.
GetRawImageDescriptionPtrprotectedGets a pointer to the image descriptor for the shared Bitmap image.
GetSharedImageClassprotectedGets the class reference used to create new shared image instances in the class.
HandleNeededprotectedEnsures that the handle for the bitmap has been assigned.
InternalReleaseBitmapHandleprotectedInternalReleaseBitmapHandle - releases Bitmap Handle and returns its value.
InternalReleaseMaskHandleprotectedInternalReleaseMaskHandle - releases Mask Handle and returns its value.
InternalReleasePaletteprotectedInternalReleasePalette - releases Palette Handle and returns its value.
RawimageNeededprotectedEnsures that the RawImage data is allocated prior to use.
SetHandleprotectedRe-implements the method from the ancestor class.
SetPixelFormatprotectedSets the value for the PixelFormat property.
UnshareImageprotectedFrees the shared image in the bitmap, and creates a new one.
UpdateHandlesprotectedSets the handles for the image and mask in the shared Bitmap to the specified values.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
AssignpublicCopies values from the specified persistent object into the class instance.
ClearpublicClears the content for the bitmap image.
FreeImagepublicReleases the resources for the image when it is discarded.
LazarusResourceTypeValidpublicDetermines if the specified resource type is valid for the image format.
BitmapHandleAllocatedpublicReturns True if a handle has been allocated for the Bitmap.
MaskHandleAllocatedpublicDetermines if the mask handle has been allocated for the image.
PaletteAllocatedpublicIndicates whether a handle has been allocated for a palette in the image.
ReleaseHandlepublicReleases the bitmap handle for the shared image.
SetHandlespublicSets handles for the bitmap and the mask to the specified values.
SetSizepublicSets 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.