From 7fda2221b8f0ca558846bae69f177d42ad78fbe8 Mon Sep 17 00:00:00 2001 From: dsiders Date: Thu, 5 Oct 2023 03:11:02 +0100 Subject: [PATCH] Docs: LCL/graphics. Updates TBitmap.LoadFromStream topic for changes in 3b4b6dd3. Issue #40529. --- docs/xml/lcl/graphics.xml | 43 +++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/docs/xml/lcl/graphics.xml b/docs/xml/lcl/graphics.xml index 15e9606a16..0ef16d301e 100644 --- a/docs/xml/lcl/graphics.xml +++ b/docs/xml/lcl/graphics.xml @@ -14826,27 +14826,48 @@ type identifier for the image format. GetResourceType returns the value in the -Loads image data from the specified stream. + +Loads image data for the bitmap from the specified stream. +

LoadFromStream is an overridden method used to read data for the -image from the TStream instance specified in AStream. -ASize contains the number of bytes to read in the method. +bitmap image from the TStream instance specified in +AStream. ASize contains the number of bytes to read in +the method.

-LoadFromStream provides supported for reading the image data from a resource -stream. When AStream is a TResourceStream instance, an image header included -in the stream is handled. This includes allocating additional storage for the -header, and setting the type and size of the image header using the correct -endian handling for bytes as needed for the platform. +LoadFromStream provides supported for loading image data from a resource +stream. When AStream is a TResourceStream instance, image headers present in +the stream are handled in the method. This allows resources created using +either the RT_BITMAP or the RT_RCDATA resource types to be handled. If both a +BMP file and BMP image header are found in the stream (RT_RCDATA), the +inherited method is called to load the image content. If the BMP file header is +omitted (RT_BITMAP), the header is created and populated with the endian-ness +for the platform and the size for the stream data. A temporary stream instance +which includes the constructed header is used to load the image content in the +inherited method.

-LoadFromStream calls the inherited method to read the image data (including -the header for a resource stream). +If AStream is not a TResourceStream instance, the inherited method is called to +read the information in the stream using the specified size. +

+

+LoadFromStream is called when the ReadData method is executed (in the +TRasterImage ancestor).

+ +Modified in LCL version 3.0 to provide support for loading image data from a +stream with content using either the RT_RCDATA or RT_BITMAP resource types. + + +TBitmapFileHeader +TResourceType +RT_BITMAP +RT_RCDATA TResourceStream
@@ -14854,7 +14875,7 @@ the header for a resource stream). Stream instance with the image data loaded in the method. -Number of bytes to read in the method. +Number of bytes to read from the stream.