Sign in Join
FPDoc Onlineexperiment

TRasterImage class

In unit Graphics

Base class for a number of graphic controls, including TCustomBitmap and TCustomIcon, which use a raster of dots to display graphic information.

Declaration

pascal
TRasterImage = class(TGraphic)

Inheritance

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

CanvaspublicThe Canvas where the raster image is rendered.
BitmapHandlepublicBitmapHandle - the Handle that has been allocated for the Bitmap.
MaskedpublicMasked - returns True if a Mask is being applied.
MaskHandlepublicThe handle allocated for the Bitmap Mask.
PixelFormatpublicStorage format for the Pixels in the Image.
RawImagepublicProvides access to the raw image data for the image type.
ScanLinepublicProvides indexed access to a scan line in the raw image data.
TransparentColorpublicColor used to represent transparent pixels in the image.
TransparentModepublicDetermines how transparent pixels are represented in the image.

Methods

CanShareImageprotectedCanShareImage - returns True if specified class of image can be shared.
ChangedprotectedChanged - method to call when properties have changed.
CreateDefaultBitmapHandleprotectedGets the default value for the Bitmap handle used in the class instance.
DrawprotectedRenders the image to the specified canvas.
GetEmptyprotectedGets the value for the Empty property.
GetHandleprotectedGets the value for the handle used in the image.
GetBitmapHandleprotectedGets the value for the BitmapHandle property.
GetMaskedprotectedGets the value for the Masked property.
GetMaskHandleprotectedGets the value for the MaskHandle property.
GetMimeTypeprotectedGets the value for the MimeType property.
GetPixelFormatprotectedGetPixelFormat - returns the pixel format for the Image.
GetRawImagePtrprotectedGets a pointer with the raw image data.
GetRawImageDescriptionPtrprotectedGets a pointer to the metadata for the raw image data.
GetTransparentprotectedGets the value for the Transparent property.
GetSharedImageClassprotectedGets the class reference used to create new shared image instances in the class.
GetHeightprotectedGets the value for the Height property.
GetWidthprotectedGets the value for the Width property.
BitmapHandleNeededprotectedEnsures that handles for the image and mask are valid for the raw image data.
HandleNeededprotectedEnsures that a handle for the image is allocated in widgetset classes.
MaskHandleNeededprotectedEnsures that a handle is allocated for the image mask (when needed).
PaletteNeededprotectedEnsures that a handle for the palette is allocated.
InternalReleaseBitmapHandleprotectedInternalReleaseBitmapHandle - releases Bitmap Handle and returns its value.
InternalReleaseMaskHandleprotectedInternalReleaseMaskHandle - releases Mask Handle and returns its value.
InternalReleasePaletteprotectedInternalReleasePalette - releases Palette Handle and returns its value.
SetBitmapHandleprotectedSets the value for the BitmapHandle property.
SetMaskedprotectedSets the value for the Masked property.
SetMaskHandleprotectedSets the value for the MaskHandle property.
SetTransparentprotectedSets the value for the Transparent property.
UnshareImageprotectedUnshares a shared image when its handle is changed or the save stream is freed.
UpdateHandlesprotectedUpdates image handles when the raw image data is loaded.
SaveStreamNeededprotectedEnsures that the save stream for the shared image is allocated.
FreeSaveStreamprotectedFrees the save stream assigned to the internal shared image.
ReadDataprotectedReads image data during component streaming.
ReadStreamprotectedReadStream - loads image data into the raw image.
SetSizeprotectedSetSize - specifies height and width of Image.
SetHandleprotectedSets the handle used for the image.
SetHeightprotectedSets the value for the Height property.
SetWidthprotectedSets the value for the Width property.
SetTransparentModeprotectedSets the value for the TransparentMode property.
SetPixelFormatprotectedSets the value for the PixelFormat property.
WriteDataprotectedWrites raw image data to the specified stream.
WriteStreamprotectedWrites the image content to the specified stream instance.
RequestTransparentColorprotectedGets the color used to represent transparent pixels in the image.
ApplyTransparentprotectedApplies transparency to an image based on the settings in Transparent, TransparentColor, and TransparentMode.
CreatepublicConstructor for the class instance.
DestroypublicDestroy is the destructor for TRasterImage: frees the canvas, and releases image then calls inherited Destroy.
AssignpublicAssign - copies details from Source according to data type.
ClearpublicRemoves raw image data and frees the internal save stream.
BeginUpdatepublicBeginUpdate - start the update process.
EndUpdatepublicEndUpdate - finishes the update process.
FreeImagepublicFrees the image by resetting its handle.
BitmapHandleAllocatedpublicBitmapHandleAllocated - returns True if a handle has been allocated for the Bitmap.
MaskHandleAllocatedpublicMaskHandleAllocated - returns True if a handle has been allocated for the Mask.
PaletteAllocatedpublicPaletteAllocated - returns True if a Palette has been allocated.
LoadFromBitmapHandlespublicLoads the image data from the specified Bitmap and Mask handles.
LoadFromDevicepublicLoads image data from the specified device context.
LoadFromStreampublicLoadFromStream - loads data for the image from a specified data stream, optionally supplying its size.
LoadFromMimeStreampublicLoads image data from a stream for the specified MIME type.
LoadFromRawImagepublicLoads image data from the specified TRawImage instance.
LoadFromIntfImagepublicLoads the image from a TLazIntfImage instance.
SaveToStreampublicSaves image data to the specified stream.
GetSupportedSourceMimeTypespublicGets a list of supported MIME types for image data used in the image type.
GetSizepublicGets the image Width and Height from the metadata for the raw image.
MaskpublicApplies the color used for transparent pixels to the image.
SetHandlespublicSets handles for the bitmap and the mask to the specified values.
ReleaseBitmapHandlepublicReleases the handle in the shared image without freeing the BitmapHandle.
ReleaseMaskHandlepublicReleaseMaskHandle - releases the Handle used for the Mask.
ReleasePalettepublicReleasePalette - release the Handle used for the Palette.
CreateIntfImagepublicCreateIntfImage - creates an image on the Interface.
HandleAllocatedpublicIndicates if a handle has been assigned for the shared image in the class.

Fields

FSharedImageprotectedShared 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.