TCustomIcon.IsStreamFormatSupported function
Indicates whether the specified stream contains image data with a format supported for use in derived TCustomIcon classes.
Declaration
class function IsStreamFormatSupported(Stream: TStream): Boolean
; overrideArguments
Stream | TStream instance with the image data examined in the method. |
Function result
Returns True if the stream starts with the StreamSignature needed for a graphic class type.
Description
IsStreamFormatSupported is an overridden
Boolean class
function in
TCustomIcon used to check whether the image data stored
in
Stream uses the StreamSignature required for an icon class
instance. It overrides the method implemented in TGraphic which always returns
False. While IsStreamFormatSupported() has been implemented for other
graphics classes like TPortableNetworkGraphics, TBitmap, TJpegImage, etc., it
was missing in TCustomIcon and its descendants TIcon and TCursorImage in
versions prior to LCL 4.4.
IsStreamFormatSupported returns True if the data stored in Stream starts with the four byte StreamSignature required for an icon class instance. The position in Stream is saved before reading the byte values, and restored when the read operation is complete.
Please note that TCustomIcon does not define the value for StreamSignature - it is defined in descendent classes like TIcon and TCursorImage which implement custom GetStreamSignature methods for the image types.
Added in LCL version 4.4.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
