diff --git a/.gitattributes b/.gitattributes
index c40f2ae5fe..3778a8c6be 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -6139,7 +6139,7 @@ docs/xml/lcl/arrow.xml svneol=LF#text/xml eol=lf
docs/xml/lcl/asyncprocess.xml svneol=native#text/plain
docs/xml/lcl/buttonpanel.xml svneol=native#text/plain
docs/xml/lcl/buttons.xml svneol=native#text/xml
-docs/xml/lcl/calcform.xml -text svneol=native#text/plain
+docs/xml/lcl/calcform.xml svneol=native#text/plain
docs/xml/lcl/calendar.xml svneol=LF#text/xml eol=lf
docs/xml/lcl/calendarpopup.xml svneol=native#text/plain
docs/xml/lcl/checklst.xml svneol=LF#text/xml eol=lf
diff --git a/docs/xml/lazutils/lazutilities.xml b/docs/xml/lazutils/lazutilities.xml
index c165f0fad0..a03579923f 100644
--- a/docs/xml/lazutils/lazutilities.xml
+++ b/docs/xml/lazutils/lazutilities.xml
@@ -10,6 +10,11 @@
- TCalculatorState is an enumerated type with values that represent the status for keys/operations in the calculator. TCalculatorState is the type used to implement the Status property in TCalculatorPanel.
-
- TCalculatorLayout is an enumerated type with values that represent the layout for keys and panels on a calculator form. TCalculatorLayout is passed as an argument to the CreateCalculatorForm routine, and to methods in TCalculatorForm and TCalculatorPanel.
-
- Key contains a character value to locate in the button captions on the panel. Keys which are not represented by buttons, like Enter (#13) and Escape (#27), are translated to the value used for the target button. In addition, when ',' is used as the decimal separator on the system, it is translated into the '.' decimal notation.
-
- FindButton iterates through the Controls on the panel to locate the button using the associated Key. The return value is Nil when a button is not located for the value in Key.
-
+ TCalculatorState is an enumerated type with values that represent the status for keys/operations in the calculator. TCalculatorState is the type used to implement the Status property in TCalculatorPanel.
+
+ TCalculatorLayout is an enumerated type with values that represent the layout for keys and panels on a calculator form. TCalculatorLayout is passed as an argument to the CreateCalculatorForm routine, and to methods in TCalculatorForm and TCalculatorPanel.
+
+ Key contains a character value to locate in the button captions on the panel. Keys which are not represented by buttons, like Enter (#13) and Escape (#27), are translated to the value used for the target button. In addition, when ',' is used as the decimal separator on the system, it is translated into the '.' decimal notation.
+
+ FindButton iterates through the Controls on the panel to locate the button using the associated Key. The return value is Nil when a button is not located for the value in Key.
+
Style can contain one of the following values:
@@ -4649,15 +4650,29 @@
+ LazarusResourceTypeValid is a Boolean function used to determine if the specified resource type is valid for the image format.
+
+ LazarusResourceTypeValid always returns False in TGraphic. The method must be overridden in descendent classes to check for resource type(s) supported for a specific image format.
+
- LoadFromMimeStream reads graphic data from a MIME-encoded stream.
+ LoadFromMimeStream reads graphic data from a stream for the given MIME type. LoadFromMimeStream compares the value in AMimeType to the value in the MimeType property. When the values are the same, the LoadFromStream method is called the load the image data for the graphic from the stream in AStream.
+ In TGraphic, an EInvalidGraphic is raised when AMimeType contains any value other than an empty string ('').
+
GetFileExtensions is a String class function used to get a delimited list of file extensions used for graphic files supported in the class. The '.' character is omitted from file extension(s), and extensions are separated by a SemiColon (;) character. For example:
@@ -8545,6 +8564,14 @@
TBitmapHandleType is an enumerated type with values that represent handle types available for Bitmaps. On Windows platforms, the handle may represent two distinctly different storage mechanisms:
@@ -8557,7 +8584,7 @@
The handle type indicates the storage format and content for the Bitmap.
- TBitmapHandleType is the type used to implement the HandleType property in TSharedCustomBitmap.
+ TBitmapHandleType is the type used to implement the HandleType property in TCustomBitmap and TSharedCustomBitmap.
@@ -8594,7 +8621,9 @@
No actions are performed in the method when the handle is already set to 0.
@@ -8998,7 +9027,9 @@
Draw uses the Device Contexts for Canvas and DestCanvas, and calls the StretchMaskBlt routine in the LCL interface to render the image using methods in the widgetset. The Changing method in DestCanvas is called before drawing the image. The Changed method in DestCanvas is called after the image is drawn.
- Implements the abstract virtual method defined in the ancestor. Property value contains the result from the IsEmpty method in the shared raster image for the class instance.
+ Implements the abstract virtual method defined in the ancestor. The property value contains the result from the IsEmpty method in the shared raster image for the class instance.
- Create sets the default value for the TransparentColor property to clDefault. This is done for Delphi compatibility where clDefault that the bottom left pixel in the image is used as the transparent color.
+ Create sets the default value for the TransparentColor property to clDefault. This is done for Delphi compatibility where clDefault indicates that the bottom left pixel in the image is used as the transparent color.
+ LoadFromMimeStream is an overridden method in TRasterImage.
+
+ LoadFromMimeStream examines the ClassType for the image to determine if it is handled in the overridden method. TBitmap, TPixmap, and TCustomIcon descendants are handled in the method.
+
+ LoadFromMimeStream compares the value in AMimeType to the PredefinedClipboardMimeTypes values defined in LCL. If AMimeType matches one of the values defined for TPixmap or TBitmap, then the LoadFromStream method is called to load image data from AStream.
+
+ Other ClassType or MIME type values cause the inherited LoadFromMimeStream method to be called.
+
+ LoadFromMimeStream is used in the implementation of the AssignGraphic method in TClipboard.
+
+ LoadFromRawImage is a procedure used to load raw image data in AImage into the class instance.
+
+ LoadFromRawImage calls BeginUpdate to increment the update process count, and calls EndUpdate when the image data has been loaded in the method.
+
+ LoadFromRawImage calls Clear to free the internal save stream for the class instance, and calls SetSize to reflect an empty image. No additional actions are performed in the method If AImage contains an empty image.
+
+ The Image Descriptor in AImage is assigned to the internal TRawImage instance to capture the image metadata.
+
+ ADataOwner indicates if the internal TRawImage instance is the owner for the image data in AImage. When set to True, values in AImage data are assigned directly to the pointer to the internal raw image data. Values include the size and content for the image data, the image mask, and the palette. When set to False, storage for values is allocated using GetMem and copied from AImage using the Move routine.
+
+ SaveToStream is an overridden method used to write image data to the stream specified in AStream.
+
+ SaveToStream calls SaveStreamNeeded to ensure that an internal save stream exists in the class instance. An EInvalidGraphicOperation exception is raised in SaveStreamNeeded when the active update count for the count is not 0 (zero). An FPImageException is raised when a TMemoryStream instance could not be created and initialized in SaveStreamNeeded.
+
+ SaveToStream resets the internal save to stream to its origin, and resizes AStream to include sufficient storage for the values in the internal save stream. The CopyFrom method in AStream is called to store the content for the internal shared image. An FPImageException is raised when the number of bytes written in the CopyFrom method does not match the size for the internal save stream.
+
+ Raises an FPImageException exception when the number of bytes written to the stream does not match the size for the raw image data.
+
+ An Exception may be raised in SaveToStream (called in the method).
+
+ GetSupportedSourceMimeTypes is an overridden method in TRasterImage used to get the list of MIME types used for image data in the image type. List is the TStrings instance where the list of supported MIME types is stored.
+
+ GetSupportedSourceMimeTypes uses the value in ClassType to determine if the request is handled in the overridden method. It is handled in the method when ClassType is TBitmap, TPixmap, or TCustomIcon. Values in the PredefinedClipboardMimeTypes constant for the TBitmap and TPixmap types are added to List. When ClassType contains any other type, the inherited method is called.
+
+ GetSupportedSourceMimeTypes is called from the AssignPicture method in TClipboard.
+
+ Calls GetRawImageDescriptionPtr to get a pointer to the image descriptor in the raw image data. When the image descriptor is Nil, or its Format contains ricfNone, the values in AWidth and AHeight are both set to 0 (zero). Otherwise, the Width and Height values in the image descriptor are used as the output parameter values.
+
+ Calls CreateMask to create and appy the mask handle required for the fixed color transparency.
+
+ SetHandles is a procedure used to set the handles for the bitmap and the mask to the values specified in ABitmap and AMask. SetHandles is an abstract virtual method in TRasterImage, and must be implemented in a descendent class to store handle values in the shared image used in the image format.
+
+ ReleaseBitmapHandle is a HBITMAP function used to release the hndle for the shared image without freeing it. The return value contains the handle value in the shared image when its ReleaseHandle method is called.
+
+ Calls BitmapHandleNeeded to ensure that the BitmapHandle and optional MaskHandle are valid for the image type. Calls FreeCanvasContext to free the cavas context when the handle been has changed.
+
+ TransparentColor is a TColor property which indicates the color used for transparent pixels in the raw image data. The default value for the property is clDefault.
+
+ TransparentColor is used along with TransparentMode to determine whether a fixed color is used for transparency, or if the tranparent color is read from a specified pixel in the raw image data.
+
+ When TransparentColor contains clDefault, the RequestTransparentColor method is used to get the transparency color value from the bottom-left pixel in the raw image data.
+
+ When setting a new value for the property, the TransparentMode property is updated as well. When clDefault is assigned to the property, TransparentMode is set to tmAuto. For other color values, TransparentMode is set to tmFixed.
+
+ MaskHandleAllocated is called to determine if a HBITMAP handle has been allocated for the MaskHandle property. When True, the MaskHandle is reset to 0 to indicate the handle is no longer in use or is invalid.
+
+ The Changed method is called to update the internal save stream for the image (when needed), set Modified to True, and signal the OnChange event handler (when assigned).
+
+ TSharedCustomBitmap is a TSharedRasterImage descendant which implements the base class for reference-counted shared images, like: TSharedBitmap, TSharedPixmap, TSharedJPEGImage, TSharedPortableNetworkGraphic and TSharedPortableAnyMapGraphic.
+
+ Calls the FreeData method in the internal TRawImage member to free the raw image data. Sets the Format in its Description property to ricfNone.
+
+ FreeImage is called from the destructor when the class instance is destroyed.
+
+ ReleasePalette is a HPALETTE function used to release the internal pallette handle for the shared bitmap. The return value contains the existing palette handle on entry.
+
+ Sets the value in the internal palette handle to 0 to indicate that the palette handle is no longer in use or is invalid.
+
+ Use FreePalette to remove the palette handle in widgetset classes.
+
+ Destroy is theoverridden destructor for TSharedCustomBitmap.
+
+ Destroy frees the internal save stream for the class instance. It also calls FreeHandle and FreeImage to free the handle and the raw image data for the shared bitmap. Calls the inherited destructor prior to exiting from the method.
+
+ HandleAllocated is an overridden method used to determine if the handle for the shared bitmap has been allocated. HandleAllocated implements the abstract virtual method defined in TSharedImage.
+
+ The return value is True when the internal handle has a non-zero value.
+
+ ImageAllocated is a Boolean function which indicates if the internal raw image data has been allocated for the shared bitmap. The return value is True when the TRawImage instance in the class has a value other than ricfNone in its image descriptor.
+
HandleType is a TBitmapHandleType property which indicates the Bitmap handle type and the storage mechanism used for the Bitmap header and data.
- Height is a read-only Integer property which contains the height for the shared bitmap image as indicated in the descriptor for the raw image data.
+ Height is a read-only Integer property which contains the height for the shared bitmap image as indicated in the descriptor for the raw image data. The property value is always 0 (zero) when the descriptor for the internal raw image data contains ricfNone.
- PixelFormat is a read-only TPixelFormat property with the storage format used for pixel data in the raw image.
+ PixelFormat is a read-only TPixelFormat property with the storage format used for pixel data in the raw image. It also determines the number of colors (or color depth) allowed in the raw image data.
+
+ See TPixelFormat for more information about the values and meanings in the enumeration.
- Width is a read-only Integer property which contains the width for the shared bitmap image as indicated in the descriptor for the raw image data.
+ Width is a read-only Integer property which contains the width for the shared bitmap image as indicated in the descriptor for the raw image data. The property value is always 0 (zero) when the descriptor for the internal raw image data contains ricfNone.
- Called when the value for PixelFormat is retrieved and the descriptor has not already been read for the image.
+ Called when the value for PixelFormat is retrieved and the image descriptor has not already been read for the shared image.
+ Calls RawImageNeeded to ensure that the image descriptor, save stream, and handle are valid for the shared Bitmap image. Calls the CreateData method in the raw image pointer (when needed) prior to exiting from the method. +
++ Calls RawimageNeeded to ensure that the image desriptor is valid. +
++ Ensures that the RawImage property is allocated prior to accessing values in the raw image data. +
++ ADescOnly indicates whether the image descriptor or the the complete raw image data is required. When ADescOnly is True, only the TRawImageDescription in the raw image is needed. When set to False, all values in the TRawImage instance are required. +
++ RawImageNeeded is called from methods access the raw image data, and occurs before the value in RawImage is accessed. For example: +
+- Implements the abstract virtual method defined in the TRasterImage ancestor. + Implements the abstract virtual method defined in the TRasterImage ancestor.
Frees the raw image data in the class instance. No actions are performed in the method when the new property value is the same as the existing property value.
@@ -10720,24 +10952,50 @@
+ UnshareImage is an overridden method used to free the shared image in the bitmap, and create a new one. UnshareImage implements the abstract virtual method defined in the ancestor class.
+
+ UnshareImage calls GetSharedImageClass to get the class type used for the shared image, and creates a new instance of the class. It is cast to TSharedCustomBitmap, and its Reference method is called to increment the reference count for the shared image.
+
+ CopyContent indicates whether the existing image data is copied into the new shared image instance. When set to True, the content in the existing shared image is copied and stored in the new shared image instance. When set to False, only the image descriptor in the shared image is copied. This gets the metadata for the image.
+
+ UnshareImage calls FreeCanvasContext to free the device context for the Canvas used in the image.
+
- Implements the abstract virtual method defined in TRasterImage.
+ UpdateHandles is an overridden Boolean function which implements the abstract virtual method defined in TRasterImage. UpdateHandles is used to set the handles for the shared bitmap image and its mask to the values specified in ABitmap and AMask.
+
+ The return value is True when the values in ABitmap and AMask are successfully applied in the class instance. The return value is False when ABitmap and Mask have the same values as the exisiting handles in the class instance, and the action is not needed.
+
+ The FreeHandle method in the internal shared image is called before applying the value in ABitmap.
+
+ FreeMaskHandle is called to free the value in MaskHandle before applying the value in AMask.
+
+ UpdateHandles is used in the implementation of the MaskHandleNeeded and SetHandles methods.
- Destroy is the destructor for the class instance. The supplied code can override the method defined for ancestor classes. + Destroy is the overridden destructor for the class instance. Destroy calls FreeMaskHandle to free the handle in MaskHandle (when assigned). Destroy calls the inherited destructor prior to exiting from the method.
- Assign: find out about the Source of the call. + Assign is an overridden method in TCustomBitmap used to copy property values from the persistent object in Source into the current class instance. Assign calls the inherited method on entry using Source as an argument.
- If the Bitmap data are already in use, the data are shared; if not, a new Bitmap is produced. + When Source is a TCustomBitmap descendant, values in its PixelFormat and PixelFormatNeedsUpdate members are copied into the members in the class instance.
+ LazarusResourceTypeValid is a Boolean function used to determine if the value in ResourceType is a valid resource type for the image format. +
++ LazarusResourceTypeValid is an overridden method in TCustomBitmap, and re-implements the method defined in the ancestor class. The return value is True when ResourceType contains one of the values: +
++ Case is not significant for the value in ResourceType; it is converted to uppercase prior to checking its value. +
++ The return value is False if ResourceType contains any other value. +
++ LazarusResourceTypeValid is used in the implementation of the LoadFromLazarusResource method. +
++ BitmapHandleAllocated is an overridden Boolean function used to determine if a handle has been allocated for the bitmap. BitmapHandleAllocated implements the abstract virtual method defined in the ancestor class. +
++ The return value is True when the handle in the internal shared image has a non-zero value. +
++ BitmapHandleAllocated is used in the implementation of the MaskHandleNeeded method. +
++ MaskHandleNeeded is an overridden Boolean function in TCustomBitmap, and is used to determine if MaskHandle has been allocated for the image mask. It implements the abstract virtual method defined in the ancestor class. +
++ The return value is True when the MaskHandle property contains a non-zero value. +
++ MaskHandleAllocated is used in the implementation of methods like: +
++ PaletteAllocated is an overridden Boolean function in TCustomBitmap, and indicates whether a handle has been allocated for a palette in the image. PaletteAllocated implements the abstract virtual method defined in the ancestor class. +
++ The return value is True when palette handle in the internal shared image contains a non-zero value. +
++ Calls HandleNeeded to ensure that the handles for the bitmap and mask reflect the values for the raw image data. Calls the ReleaseHandle method in the shared image to free the handle for the bitmap. +
++ SetHandles is a procedure used to set the handles for the bitmap and the mask to the values specified in ABitmap and AMask. SetHandles ensures that the Canvas context, shared image, and save stream are unshared and freed. SetHandles calls UpdateHandles to store the specified handles for the shared image and its mask. +
++ SetHandles is called from methods that load image data using TLazIntfImage from the LCL interface. It is also called when values are assigned to the BitmapHandle or MaskHandle properties. +
++ SetSize is an overridden method in TCustomBitmap used to change the Height and Width for the bitmap image to the specified values. SetSize implements the abstract virtual method defined in the ancestor class. +
++ Calls RawImageNeeded to ensure that the image header in RawImage is valid for the image. +
++ The values in AWidth and AHeight contain the new dimensions for the image. Both values must contain a positive value or 0. The default value for an argument is set to 0 when a negative value is found. Their values are assigned to the image desriptor in the shared imaged to change the size for the image content. No additional actions are performed in the method if either value is not successfully applied to the raw image descriptor. +
++ Calls UnshareImage and RawImageNeeded to re-create the raw image data for the shared image. +
++ Copies exisiting pixel data for the image into the resized image. When the new image size is smaller, only the portion of the image that fits within the new dimensions is copied. Uses the CopyPixels method in the TLazIntfImage instance to copy the image content. +
++ Ensures that the Canvas context, BitMapHandle, and MaskHandle are updated for the image. Calls the Changed method to update the shared image data and signal the OnChange event handler (when assigned). +
++ In TCustomBitmap, the handle is provided by the internal shared image class (TSharedCustomBitmap) and stored in the BitmapHandle property. +
++ HandleType is a TBitmapHandleType property which indicates the handle type used for the bitmap image data. HandleType identifies whether the bitmap handle is classified as a Device-Dependent Bitmap (DDB) or a Device-Independent Bitmap (DIB). +
++ See TBitmapHandleType for more information about the handle types and their specifics. +
++ The value for the property is read from the internal shared image in the class instance. Setting a new value for the property has no effect in the current implementation; the value is always read from the raw image data. +
++ Monochrome is a Boolean property which indicates whether the raw image data is represented using pixels of a single color. +
++ The property value is True when the descriptor for the shared raw image data has a color depth of 1. The PixelFormat property willl also contain the value pf1bit. +
++ Setting a new value in Monochrome causes the value in PixelFormat to be changed. When set to True, PixelFormat is set to pf1bit. When set to False, the value pfDevice is assigned to the PixelFormat property. +
++ Changing the value in Monochrome (and PixelFormat) causes the image data to be discarded, and the Handle for the internal shared image is freed. +
++ No actions are performed when Monochrome is set to the existing value for the property. +
++ WriteStream is an overridden procedure in TFPImageBitmap used to write the image content to the stream specified in AStream. WriteStream implements the abstract virtual method defined in TRasterImage. +
++ WriteStream creates temporary TLazIntfImage and TFPCustomImageWriter instances that are used to write the data for the internal TRawImage instance used in the class. Raw image data is stored in the TLazIntfImage instance, and its SaveToStream method is called to write the values to AStream. +
++ No actions are performed in the method when the data size for the raw image is 0. +
++ Always returns an empty string ('') in TFPImageBitmap. +
++ IsFileExtensionSupported is a Boolean class function used to determine if the file extension in FileExtension is valid for the image type. If FileExtension includes a period character ('.'), it is removed before use. +
++ The return value is True when FileExtension is included in the value returned by the GetFileExtensions method. No actions are performed in the method when FileExtension is an empty string (''). +
++ IsFileExtensionSupported is used in the implementation of LazarusResourceTypeValid. +
++ LazarusResourceTypeValid is a Boolean function used to determine if the value in ResourceType is a valid resource type for the image format. +
++ LazarusResourceTypeValid is an overridden method, and re-implements the method defined in the ancestor class. The return value is True when ResourceType contains is one the file extensions returned from IsFileExtensionSupported. The return value is False if ResourceType contains any other value. +
++ LazarusResourceTypeValid is used in the implementation of the LoadFromLazarusResource method. +
++ TSharedBitmap is a TSharedCustomBitmap descendant. +
++ GetReaderClass is an overridden TFPCustomImageReaderClass class function used to get the FCL-compatible reader for the image type. The return value is a TLazReaderBMP class reference in TBitmap. +
++ GetReaderClass is called from the ReadStream method when the reader is created and intialized. It is used to load a TLazIntfImage instance with the image content supplied in a stream. It is also used in the IsStreamFormatSupported method to determine if the stream contains an image format that can be read using the reader class type. +
+ The return value is a TLazWriterBMP class reference in TBitmap. +
++ GetWriterClass is called from the WriteStream method when the image writer is used to write a TLazIntfImage instance to a stream. +
+ GetSharedImageClass provides a class reference used to create new instances of the shared image class used in TBitmap. +
++ The return value is a TSharedBitmap class reference in TBitmap. +
++ GetSharedImageClass is called from methods like Create, Assign, and CanShareImage. +
- PixMap ensures that specified resources (image, file, or stream) are of correct type and format. + TPixmap ensures that specified resources (image, file, or stream) are of the correct type and format.
TSharedIcon is a TSharedRasterImage descendant which implements a reference counted shared Icon. TSharedIcon provides access to the list of images available in the Icon as TIconImage instances using the Images property. Methods are provided to add, delete, clear, sort, and retrieve the images.
@@ -12111,13 +12571,13 @@
- Gets the ordinal position in the internal image list for the icon with the specified pixel format, height, and width. The return value is -1 if an image using all of the requested values was not found in the list.
+ Gets the ordinal position in the internal image list for the icon with the specified pixel format, height, and width. The return value is -1 if an image using all of the requested values was not found in the list.
- Assign the return value to the Current property to use it as the selected image for the icon.
+ Assign the return value to the Current property to use it as the selected image for the icon.
- Use GetBestIndexForSize to find the position of the image which matches most closely the specified height and width.
+ Use GetBestIndexForSize to find the position of the image which matches most closely the specified height and width.
- GetDefaultSize is a TSize class function used to gets the default size used for new instances of the class. The return value uses the SM_CXICON and SM_CYICON values returned from the GetSystemMetrics function in its cx and cy members.
+ GetDefaultSize is a TSize class function used to get the default size in new instances of the class. The return value uses the SM_CXICON and SM_CYICON values returned from the GetSystemMetrics function in its cx and cy members.
- GetMaskHandle implements the abstract method defined in the ancestor class.
+ GetMaskHandle implements the abstract method defined in the ancestor class.
@@ -12317,7 +12777,9 @@ HandleNeeded calls the CreateIconIndirect routine for the widgetset to get the value used as the Handle for the shared image.
+ ReadData is an overridden method used to read the data for the class instance from the TStream instance specified in Stream. ReadData is the method called when TFiler reads a persistent object during LCL component streaming. +
++ ReadData saves the position in Stream on entry, and restores the original position prior to exiting from the method. +
++ ReadData checks the values in Stream to determine if a size prefix for the content is stored in the stream. Delphi streaming does not include the size prefix. Current Lazarus versions do. When the LongInt value used as the StreamSignature is 0, the LoadFromStream method is called to load the contents of the stream. Otherwise, the inherited method is called to complete the operation. +
++ ReadData is also called from the LoadFromResourceHandle method in TIcon. +
++ ReadStream is an overridden procedure used to read the content for the icon from the stream specified in AStream. ReadStream implements the abstract virtual method defined in the ancestor class. +
++ ReadStream verifies that AStream contains an icon image by checking for header value(s) that are valid for .ICO data. If the header values are nopt found, an EInvalidGraphic exception is raised. +
++ For icon data, the icon directory must be read from the stream. The header contains the number of icon directory entries included in the stream. The icon directory entries are read from AStream, and include values for each icon image that includes: +
++ ReadStream positions the stream, and reads image data for the each of the icon directory entries. It handles both DIB Bitmap and PNG (used in WIndows Vista) image data for the icon images. An FCL-compatible image reader is created as required for the image type, and a TLazIntfImage instance is used to capture the raw image data from the stream. Images read from the stream are added to the internal list of images in the TSharedIcon member for the class instance. +
++ ReadStream calls CheckRequestedSize to use the Width and/or Height specified in the class instance. GetBestIndexForSize is called to determine the value in Current with the requested image size. +
++ SetMasked is an empty implementation in TCustomIcon. +
++ Changing the value for PixelFormat raises an EInvalidGraphicOperation exception in TCustomIcon. +
++ SetTransparent is an empty implementation in TCustomIcon. +
++ UnshareImage is an overridden procedure used to stop sharing the image(s) for the icon. UnshareImage implements the abstract virtual method defined in the enacestor class. +
++ No actions are performed in the method when the RefCount for the internal TSharedIcon instance is less than 1. +
++ When sharing is stopped, the internal TSharedIcon instance in the class is re-created. +
++ CopyContent indicates whether exising content from icon images is copied into the new image list. When set to True, TIconImage instances are re-created for each of the icon images and their existing content is copied. When set to False, image data for the icon is empty. +
++ UnshareImage calls FreeCanvasContext to discard the device context used in the Canvas. +
++ UnshareImage calls the Release method for the old TSharedIcon instance. +
++ UnshareImage is called from methods which alter the handle or image content for the icon, including: +
++ UpdateHandles is an overridden method used to set the Bitmap and Mask handles for the Current icon image to the specified values. UpdateHandles implements the abstract virtual method defined in the ancestor class. +
++ UpdateHandles uses the value in Current to determine the TIconImage in the internal image list that is updated in the method. +
++ When Current is set to -1, an icon image has not been selected and no actions are performed in the method. The return value is False if the handles could not be applied to icon image. +
++ UpdateHandles calls the UpdateHandles method for the TIconImage indicated in Current using the values in ABitmap and AMask as arguments. The return value is True if the handles are successfully applied to the icon image. +
++ UpdateHandles is called from methods like: +
++ WriteStream is an overridden method used to write the content for the multi-image icon to the stream specified in AStream. WriteStream implements the abstract virtual method defined in the ancestor class. +
++ WriteStream performs actions needed to write the header, icon directory, and content for each of the images used in the multi-image icon to the TMemoryStream instance. It handles both PNG and DIB Bitmap icon images, and creates Mask data for images when it is not already present. +
++ For icon images used in TCursorImage, the X and Y coordinates for the HotSpot are also included in the image data. +
++ WriteStream is called from SaveStreamNeeded when the SaveToStream method is performed. +
++ Add is procedure used to create an image for the icon with the attributes specified in AFormat, AHeight, and AWidth. Add calls GetIIndex to determine if an icon image with the requested attributes already exists in the image list for the icon. An EInvalidGraphicOperation exception is raised when the image already exists in the internal image list. +
++ Add calls UnshareImage to release the shared image handle, and adds a new image class instance to the shared icon. If the icon image is the first one in the list, the value in Current is set to 0 (zero) and the UpdateCurrentView method is called. +
++ Use Current to make an icon image active for the class instance. Use AssignImage to store the image at the position in Current. +
++ Assign is an overridden method used to copyvalues from the persistent object in Source into the current class instance. Assign calls BeginUpdate to increment the active update counter, and calls EndUpdate prior to exiting from the method. +
++ Assign handles specific class types in Source, including: +
++ When Source is derived from another class type, the inherited Assign method is called. +
++ AssignImage is used to copy image data from ASource to the currently selected image for the icon. +
++ AssignImage is typically used to assign the icon image when Add is used to create a new icon image with the required attributes (PixelFormat, Height, Width). AssignImage is called from the Assign method to store a single raster image to the icon. +
++ Clear is an overridden method used to remove the image content for the icon. Clear frees the internal save stream for the image. The internal shared image is also freed and re-created. The value in Current is set to -1 to indicate that an icon image has not been selected. +
++ Clear calls the Changed method to set the value in Modified and signal the OnChange event handler (when assigned). +
++ No actions are performed in the method when Empty returns True. +
++ Delete is a procedure used to delete the icon image at the ordinal position specified in AIndex from the list of images for the icon. +
++ Delete calls UnshareImage to stop sharing the image list for the icon. A copy of the images is kept and restored when the Delete method in TSharedIcon has removed the image at the specified postion. +
++ When AIndex is also the Current image for the icon, Current is set to -1 and the UpdateCurrentView method is called. Otherwise, the value in Current is decremented. +
++ Use Remove to delete an icon image with specific PixelFormat, Height, and Width values. +
++ Use Add to add an icon image with specific PixelFormat, Height, and Width values. +
++ Use Count to determine the number of images in the list of images for the icon. +
++ Remove is used to locate and delete an icon image with the attributes specified in AFormat, AHeight, and AWidth. +
++ Remove calls GetIndex to get the position in the internal image list where the icon image with the specified attributes is stored. If an image is found, the Delete method is called to the remove the icon image. +
++ The value in Current is modified when it represents an icon image affected by the removal. Current is set to -1 when it contains the index for the icon image removed in the method. +
++ GetDescription is used to get image metadata whcih describes the icon image at the position specified in AIndex. AFormat, AHeight, and AWidth are output parameters where the corresponding values from the TIconImage instance are stored. +
++ GetDescription accesses the image list in the internal TSharedIcon instance used in the class. +
++ SetSize is an overridden method used to set the size for the image in the icon to the values specified in AWidth and AHeight. SetSize implements the abstract virtual method defined in the ancestor class. SetSize stores the argument values in an internal member used to track the requested icon image size used in the GetBestIndexForSize method. +
++ SetSize raises an EInvalidGraphicOperation exception when an icon size has been selected by setting a value in the Current property. +
++ SetSize is called from the ReadStream method. +
++ GetFileExtensions is an overridden String class function used to get a delimited list of file extensions supported for the image type. In TCustomIcon and TIcon, the return value is always 'ico'. +
++ LazarusResourceTypeValid is an overridden Boolean function used to determine if the specified resource type is valid for the image format. +
++ The return value is True when ResourceType contains 'ICO' or 'ICON'. The inherited method is called to get the return value when ResourceType contains any other resource type name. Case is not significant when comparing the value in ResourceType; it is converted to uppercase in the method. +
++ LoadFromResourceName is an overridden procedure used to load a resource with the name specified in ResName using the handle provided in Instance. LoadFromResourceName re-implements the method defined in the ancestor class, and does not call the inherited method. +
++ LoadFromResourceName calls GetResourceType to get the Integer resource type used in the class instance. No actions are performed in the method when the TResourceType value is unassigned (contains Nil). +
++ LoadFromResourceName calls FindResource to get the resource handle needed in the method. An EResNotFound exception is raised if a resource with the specified name and type is not found in FindResource. +
++ LoadFromResourceName calls LoadFromResourceHandle to load the icon using the Instance and resource handle values. +
++ Use LoadFromResourceID to load a resource by its Resource ID. +
++ Use LoadFromLazarusResource to load a Lazarus resource from a .lrs file with a give name. +
++ LoadFromResourceID is an overridden procedure used to load a resource with the specified Resource ID into the class instance. LoadFromResourceID re-implements the method defined in the ancestor class, and does not call the inherited method. +
++ Instance contains the Handle used to read the resource. ResID contains an Integer pointer to the resource identifier loaded in the method. +
++ LoadFromResourceID calls GetResourceType to get the Integer resource type used in the class instance. No actions are performed in the method when the TResourceType value is unassigned (contains Nil). +
++ LoadFromResourceName calls FindResource to get the resource handle needed in the method. An EResNotFound exception is raised if a resource with the specified ID and type is not found in FindResource. +
++ LoadFromResourceName calls LoadFromResourceHandle to load the icon using the Instance and resource handle values. +
++ Use LoadFromResourceName to load a resource with a given resource name. +
++ Use LoadFromLazarusResource to load a Lazarus resource from a .lrs file with a give name. +
++ LoadFromResourceHandle has an empty implementation in TCustomIcon. It is re-implemented in TIcon descendant. +
++ BitmapHandleAllocated is an overridden Boolean function which indicates if a handle for the icon image has been allocated in the class instance. BitmapHandleAllocated implements the abstract virtual method defined in the ancestor class. +
++ The return value is True when Current has a valid image index for the icon image, and the handle for the TIconImage in the shared icon has a non-zero value. +
++ BitmapHandleAllocated is called from methods that required a valid image handle prior to performing actions using the image data. For example: +
++ MaskHandleAllocated is an overridden method used to determine if a handle for the image mask has been allocated in the class instance. MaskHandleAllocated implements the abstract virtual method defined in the ancestor class. +
++ The return value is True when Current contains a value other than -1, and the MaskHandle for the TIconImage in the shared image list has a non-zero value. +
++ MaskHandleAllocated is called from methods that required a valid handle prior to performing actions using the mask image data. For example: +
++ PaletteAllocated is an overridden method used to determine if a handle has been allocated for the Palette in the icon image. PaletteAllocated implements the abstract virtual method defined in the ancestor class. +
++ The return value is True when Current contains a value other than -1, and the palette handle in the TIconImage instance for the shared icon image has a non-zero value. +
++ SetHandles has an empty implementation in TCustomIcon. +
Sorts images in the internal image list for the icon. The Sort method in TSharedIcon is called to perform the sort, and compares the Width/PixelFormat values in the images to determine the sort order. Preference is given to the value in Width; if two items have the same Width, the value in PixelFormat is used for the comparison.
++ Sort keeps a reference to the image in Current when it is set to a value other than -1. The image is used to restore the value in Current when the sort operation is completed. The IndexOf method for the internal image list is called determine the new position for the referenced image. +
-Current is an Integer property which contains the ordinal position for the selected image in the icon. Setting a new value for the property causes the UpdateCurrentView method to be called to update the Canvas, and the save stream for the shared image. The OnChange event handler is signalled (when assigned). @@ -12757,15 +13596,13 @@
Count is a read-only Integer property which contains the number of images in the internal image list for the icon. Read access for the property value is redirected to the Count property in the internal TSharedIcon instance used in the class.
- Use methods like Add, Delete, Remove, Clear, Assign, and AssignImage to maintain the list of images available in the icon. + Use methods like Add, Delete, Remove, Clear, Assign, and AssignImage to maintain the list of images available in the icon.
@@ -12817,51 +13654,72 @@
+ Ensures that Handle values are valid for the icon. Configures the values in IconInfo with the BitmapHandle and MaskHandle for the class instance. Calls CreateIconIndirect for the widgetset to get the Handle used for the shared image in the icon.
+
+ No actions are performed in the method when the Handle for the shared icon image has already been assigned.
+
+ The return value is RT_GROUP_ICON in TIcon.
+
+ Handle is a HICON property which contains the icon handle used to access image data for the icon. The property value is provided by the GetHandle method.
+
+
+ Provides a HotSpot property with the coordinates in the cursor that is the point that interacts with other elements on the screen.
+
+ Calls the inherited constructor on entry using the value in AInfo as an argument. AInfo contains the coordinates that are assigned to the HotSpot property.
+
+ Handle is a HCURSOR property in TCursorImage, and contains the handle used to identify the cursor image. The value for the property is provided by the GetHandle method.
+
+ Setting a new value for Handle causes the device context in Canvas to be freed, and the shared image for the icon is cleared. The UpdateHandle method is called to update the shared image using the new value for the property. If the shared icon contains image data, the value in Current is set to 0 (the first image in the internal list of images). Otherwise, Current is set to -1.
+
+ Changed is called to re-create the internal save stream for the shared image and signal the OnChange event handler (when assigned).
+
- TJPEGImage is a TFPImageBitmap descendant which implements support for the JPEG image format. JPEG images are commonly used for storing digital photographs. They can represent detailed color photos using a high degree of compression, resulting in very efficient storage, though with some loss of quality.
+ TJPEGImage is a TFPImageBitmap descendant which implements support for the JPEG (Joint Photographic Experts Group) image format. JPEG images are commonly used for storing digital photographs. They can represent detailed color photos using a high degree of compression, resulting in very efficient storage, though with some loss of quality.
JPEG image files normally have a file extension like: jpeg, jpg, jpe, or jfif.
@@ -13357,24 +14246,41 @@
+ InitializeReader is an overridden method used transfer property values specific to the JPEG image in AImage to the TFPCustomImageReader class instance in AReader. The following property values are stored to the corresponding properties in AReader:
+
Extreme compression can lead to loss of quality at the expense of a small file size.
@@ -13474,6 +14380,7 @@
The allowed range is 1..100, where 100 is best quality, and 25 is pretty awful.
+ Scale is a TJPEGScale property which contains one of the prefined scaling values applied to the raw image data. For instance:
+
+ Smoothing is a Boolean property which indicates if smoothing is applied to raw data in the image. Smoothing uses a low pass filter to remove high spatial frequency noise from a digital image.
+
+ The value in Smoothing is used in the InitializeReader method to configure the image reader used to load the raw image data. Set the value in Smoothing prior to calling methods which load the image content using an FCL-compatible image reader.
+
+
+
+
+
- TTiffImage has properties which expose values for selected Tag names in the image data, including: + TTiffImage has properties which expose values for Baseline Tags in the image data, including:
TGIFImage is a TFPImageBitmap descendant which implements support for the GIF (Graphics Interchange Format) image format. GIF images support up to 8 bits per pixel in the image data, and a color palette of up to 256 colors from the 24-bit RGB color space. While GIF images allow animation, the LCL implementation does not support the feature.
@@ -13788,7 +14717,8 @@
+ Ensures that image properties discovered using the reader class are applied to the properties in the GIF image.
+
+ Calls the inherited method on entry. Copies values found in AReader to the following properties:
+
+ FinalizeReader is called from the ReadStream method when the reader class has loaded the image content into a TLazIntfImage instance.
+
+ BitsPerPixel indicates the color depth (or maximum number of colors) that can be represented in the image data.
+
+ Calls GetPicFileFormats to get the list which maps TGraphicClass (or descendent) references to a file extension.
+
+ GraphicExtension iterates over the values in the mapping list in reverese order, and compares the class name for the list item to the class name in GraphicClass. When a match is found, the GetFormatExt method for the item is called to get the return value for the function.
+
+ The return value is an empty string ('') when a mapping for GraphicClass is not found in the list.
+
- IdentEntry - checks that a given Entry exists in a Map of color names.
+ IdentEntry checks whether a given Entry exists in a Map of color names.
A list of system Colors is specified as a look-up table of indices (Entry) and names (MapEntry).
@@ -14043,7 +15010,7 @@
+ ColorToRGB ensures that TColor values for special and sytem colors remove the non-RGB values in the constant.
+
+ Parses a font name in XLFD format and extracts the FamilyName sequence with the typeface family name.
+
+
+
+ FontResourceCache is a TFontHandleCache variable used as the cache for Font resources. FontResourceCache allows reference-counted font handles to be created or retrieved when the ReferenceNeeded method in TFont is called. Values in FontResourceCache are maintained when the FreeReference method in TFont is called. +
+
+ Resources for FontResourceCache are allocated when the
- Converts a multiline string to a single line. Replaces CR and LF with spaces. Removes duplicate spaces. -
-