TCustomIcon class
TCustomIcon - base class for TIcon.Declaration
TCustomIcon = class(TRasterImage)Inheritance
- TCustomIcon
- TRasterImage
- TGraphic
- TPersistent
- TObject
Descends from it: TCursorImage TIcnsIcon TIcon
Description
TCustomIcon is a
TRasterImage descendant which
implements the base class for TIcon. TIcon supports image files using the
.ICO file format. An .ICO file typically contains several images with
different sizes and/or color depths.
TCustomIcon extends the ancestor class to include an internal list of images,
and provides overridden methods which use the list of images in their
implementations. This includes the ReadData method used during LCL
component streaming. ReadStream is overridden to handle not only
multiple images but PNG and DIB image formats used in some Icon
files.
When loading an icon file, the largest/most colorful image is selected as the
current image. Other sizes and/or color depths are accessed by setting the
value in the Current property, or using Size when
Current is not already set, or by setting Current to the value from the
GetBestIndexForSize method.
Use the Count, Add, Delete,
Remove, Clear, and AssignImage methods to
maintain the images in the internal list.
See also
Properties
Current | public | Ordinal position for the current image displayed for the icon. |
Count | public | Number of images in the image list for the shared icon. |
Methods
MaskHandleNeeded | protected | Ensures that a handle for the mask in the icon is valid. |
PaletteNeeded | protected | An empty implementation in TCustomIcon. |
CanShareImage | protected | Indicates whether the image class type has a shared handle. |
CheckRequestedSize | protected | CheckRequestedSize - method to ensure correct size requested. |
GetIndex | protected | GetIndex - returns the Index value of the Icon with specified format and size (.icn files can contain several versions of image). |
GetBitmapHandle | protected | Gets the value for the BitmapHandle property. |
GetDefaultSize | protected | GetDefaultSize - returns default size for Icon. |
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 to the raw image data for the icon. |
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. |
GetStreamSignature | protected | Gets the stream signature used for icon data. |
GetTypeID | protected | Gets the icon type identifier used in the image list header. |
HandleNeeded | protected | Ensures that a handle for the image has been 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. |
IsStreamFormatSupported | protected | Indicates whether the specified stream contains image data with a format supported for use in derived TCustomIcon classes. |
ReadData | protected | Reads data for the class instance from a stream. |
ReadStream | protected | Reads the content for the icon from the specified stream. |
SetPixelFormat | protected | Sets the value for the PixelFormat property. |
SetTransparent | protected | Sets the value for the Transparent property. |
UnshareImage | protected | Unshares the shared image when the content in the icon is changed. |
UpdateCurrentView | protected | UpdateCurrentView - updates the current appearance of the Icon. |
SetHandle | protected | Unshares an existing shared image handle and set the new value. |
UpdateHandle | protected | Updates the handle in the shared icon image top the specified value. |
UpdateHandles | protected | Sets the Bitmap and Mask handles for the current image in the icon. |
WriteStream | protected | Writes the content for the multi-image icon to the specified stream. |
Create | public | Constructor for the class instance. |
Add | public | Add - an Icon formatted as AFormat, with specified Height and Width. |
Assign | public | Copies values from the specified persistent object into the current class instance. |
AssignImage | public | Copies image data from the source image to the current icon image. |
Clear | public | Removes the image content for the icon. |
Delete | public | Deletes the image at the specified position in the list of images for the icon. |
Remove | public | Removes an icon image with the specified attributes. |
GetDescription | public | Gets metadata which describes the icon image at the specified position in the image list. |
SetSize | public | Sets the size (width, height) for the image in the Icon. |
GetFileExtensions | public | Gets a delimited list of file extensions supported for the image type. |
LazarusResourceTypeValid | public | Determines if the specified resource type is valid for the image format. |
LoadFromResourceName | public | Loads the icon with the specified resource name from the instance handle. |
LoadFromResourceID | public | Load icon data from a resource with the specified integer resource identifier. |
LoadFromResourceHandle | public | Loads icon data from the specified instance and resource handles. |
BitmapHandleAllocated | public | Indicates if a handle for the icon image has been allocated. |
MaskHandleAllocated | public | True if a handle has been allocated for the mask in the image. |
PaletteAllocated | public | Determine if a handle has been allocated for the Palette in the icon. |
SetHandles | public | Not implemented in TCustomIcon. |
Sort | public | Sorts the images for the icon. |
GetBestIndexForSize | public | Gets the ordinal position for the image closest to the requested size. |
ExportImage | public | Exports the image for the icon at the specified index to another TFPImageBitmap class instance. |
Fields
FCurrent | protected | Local member variable used to hold the current sequence number. |
FRequestedSize | protected | Member used for the requested icon size. |
Inherited
From TRasterImage (49)
ApplyTransparent BeginUpdate BitmapHandle BitmapHandleNeeded Canvas Changed CreateDefaultBitmapHandle CreateIntfImage Destroy Draw EndUpdate FreeImage FreeSaveStream GetEmpty GetHandle GetHeight GetMasked GetMimeType GetSize GetSupportedSourceMimeTypes GetWidth HandleAllocated LoadFromBitmapHandles LoadFromDevice LoadFromIntfImage LoadFromMimeStream LoadFromRawImage LoadFromStream Mask Masked MaskHandle PixelFormat RawImage ReleaseBitmapHandle ReleaseMaskHandle ReleasePalette RequestTransparentColor SaveStreamNeeded SaveToStream ScanLine SetBitmapHandle SetHeight SetMasked SetMaskHandle SetTransparentMode SetWidth TransparentColor TransparentMode WriteData
From TGraphic (23)
DefineProperties Empty Equals GetResourceType Height LoadFromClipboardFormat LoadFromClipboardFormatID LoadFromFile LoadFromLazarusResource 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.
