From c114b0811b4eedda897943ec5d3f1e7238ea0ac3 Mon Sep 17 00:00:00 2001 From: kirkpatc Date: Fri, 19 Oct 2007 06:40:36 +0000 Subject: [PATCH] Tried to fix problems in TGraphic and TPicture git-svn-id: trunk@12518 - --- docs/xml/lcl/graphics.xml | 131 +++++++++++++------------------------- 1 file changed, 43 insertions(+), 88 deletions(-) diff --git a/docs/xml/lcl/graphics.xml b/docs/xml/lcl/graphics.xml index 9dfa45a4cf..0fbb544dbd 100644 --- a/docs/xml/lcl/graphics.xml +++ b/docs/xml/lcl/graphics.xml @@ -2460,28 +2460,24 @@ Base class for dealing with Graphic images -

The TGraphic class is an abstract base class for dealing with graphic images such as bitmaps, pixmaps, icons, and other image formats. It does not contain an actual area for displaying the image; this is provided by the descendant classes eg BitMap, Icon etc which have a Canvas element defined


LoadFromFile - - Read the graphic from the file system. The old contents of the graphic are lost. If the file is not of the right format, an exception will be generated.
SaveToFile - - Writes the graphic to disk in the file provided.
LoadFromStream - - Like LoadFromFile - except source is a stream (e.g. TBlobStream -).
SaveToStream - - stream analogue of SaveToFile -.
LoadFromClipboardFormat - - Replaces the current image with the data provided. If the TGraphic - does not support that format it will generate an exception.
SaveToClipboardFormats - - Converts the image to a clipboard format. If the image does not support being translated into a clipboard format it will generate an exception.
Height - - The native, unstretched, height of the graphic.
Palette - - Color palette of image. Zero if graphic doesn't need/use palettes.
Transparent - - Some parts of the image are not opaque, ie the background can be seen through.
Width - - The native, unstretched, width of the graphic.
OnChange - - Called whenever the graphic changes
PaletteModified - - Indicates in OnChange - whether color palette has changed. Stays true until whoever is responsible for realizing this new palette (ex: TImage) sets it to False.
OnProgress - - Generic progress indicator event. Propagates out to TPicture - and TImage OnProgress - events. -

As many of the methods and properties are virtual and/or abstract, it is the responsibility of the application programmer to supply suitable methods when implementing any descendant classes

+ The TGraphic class is an abstract base class for dealing with graphic images such as bitmaps, pixmaps, icons, and other image formats. It does not contain an actual area for displaying the image; this is provided by the descendant classes eg BitMap, Icon etc which have a Canvas element defined
+ LoadFromFile - Read the graphic from the file system. The old contents of the graphic are lost. If the file is not of the right format, an exception will be generated.
+ SaveToFile - Writes the graphic to disk in the file provided.
+ LoadFromStream - Like LoadFromFile except source is a stream (e.g. TBlobStream +).
+SaveToStream - stream analogue of SaveToFile .
+LoadFromClipboardFormat - Replaces the current image with the data provided. If the TGraphic + does not support that format it will generate an exception.
+ SaveToClipboardFormats - Converts the image to a clipboard format. If the image does not support being translated into a clipboard format it will generate an exception.
+ Height - The native, unstretched, height of the graphic.
+ Palette - Color palette of image. Zero if graphic doesn't need/use palettes.
+ Transparent - Some parts of the image are not opaque, ie the background can be seen through.
+ Width - The native, unstretched, width of the graphic.
+ OnChange - Called whenever the graphic changes
+ PaletteModified - Indicates in OnChange whether color palette has changed. Stays true until whoever is responsible for realizing this new palette (ex: TImage) sets it to False.
+ OnProgress - Generic progress indicator event. Propagates out to TPicture + and TImage OnProgress events.

+ As many of the methods and properties are virtual and/or abstract, it is the responsibility of the application programmer to supply suitable methods when implementing any descendant classes
@@ -2885,8 +2881,8 @@ If the file is not of the right format, an exception will be generated. - Palette - Color palette of image - Palette - Color palette of image. Zero if graphic doesn't need/use palettes + Palette - Color palette of image + Palette - Color palette of image. Zero if graphic doesn't need/use palettes @@ -2896,12 +2892,12 @@ If the file is not of the right format, an exception will be generated. - Transparent - Some parts of the image are not opaque. ie the background + Transparent - Some parts of the image are not opaque. ie the background can be seen through - Width - The native, unstretched, width of the graphic. + Width - The native, unstretched, width of the graphic. @@ -2911,8 +2907,8 @@ If the file is not of the right format, an exception will be generated. - TPicture is a TGraphic container, used in place of a TGraphic if the graphic can be of any TGraphic class. - TPicture + TPicture is a TGraphic container, used in place of a TGraphic if the graphic can be of any TGraphic class. + TPicture is a TGraphic container. It is used in place of a TGraphic if the graphic can be of any TGraphic @@ -2928,67 +2924,26 @@ It is not a direct descendant of TGraphic Defines many private methods for getting and storing various sorts of images such as bitmaps, pixmaps, icons, PNGs etc
-It does not itself contain a defined area for displaying the image, but this is supplied by the descendant classes such as BitMap, PixMap, PNG or Icon, which define a Canvas property.

LoadFromFile - and SaveToFile - are polymorphic. For example, if the TPicture - is holding an Icon -, you can LoadFromFile - a bitmap file, where if the class is TIcon - you could only read .ICO files.

LoadFromFile +It does not itself contain a defined area for displaying the image, but this is supplied by the descendant classes such as BitMap, PixMap, PNG or Icon, which define a Canvas property.

+LoadFromFile and SaveToFile are polymorphic. For example, if the TPicture is holding an Icon, you can LoadFromFile a bitmap file, where if the class is TIcon you could only read .ICO files.

+LoadFromFile - Reads a picture from disk. The TGraphic class created is determined by the file extension of the file. If the file extension is not recognized an exception is generated.
+SaveToFile - Writes the picture to disk.
+LoadFromClipboardFormat - ToDo: Reads the picture from the handle provided in the given clipboard format. If the format is not supported, an exception is generated.
+SaveToClipboardFormats - ToDo: Allocates a global handle and writes the picture in its native clipboard format (CF_BITMAP for bitmaps, CF_METAFILE for metafiles, etc.). Formats will contain the formats written. Returns the number of clipboard items written to the array pointed to by Formats and Datas or would be written if either Formats or Datas are nil.
+SupportsClipboardFormat - Returns true if the given clipboard format is supported by LoadFromClipboardFormat - - Reads a picture from disk. The TGraphic - - class created is determined by the file extension of the file. If the file extension is not recognized an exception is generated.
SaveToFile - - - Writes the picture to disk.
LoadFromClipboardFormat - - - ToDo: Reads the picture from the handle provided in the given clipboard format. If the format is not supported, an exception is generated.
SaveToClipboardFormats - - - ToDo: Allocates a global handle and writes the picture in its native clipboard format (CF_BITMAP for bitmaps, CF_METAFILE for metafiles, etc.). Formats will contain the formats written. Returns the number of clipboard items written to the array pointed to by Formats and Datas or would be written if either Formats or Datas are nil.
SupportsClipboardFormat - - - Returns true if the given clipboard format is supported by LoadFromClipboardFormat - -.
Assign - - - Copies the contents of the given TPicture - -. Used most often in the implementation of TPicture properties.
RegisterFileFormat - - - Register a new TGraphic - - class for use in LoadFromFile - -.
RegisterClipboardFormat - - - Registers a new TGraphic - - class for use in LoadFromClipboardFormat - -.
UnRegisterGraphicClass - - - Removes all references to the specified TGraphic - - class and all its descendants from the file format and clipboard format internal lists.
Height - - - The native, unstretched, height of the picture.
Width - - - The native, unstretched, width of the picture.
Graphic - - - The TGraphic - - object contained by the TPicture
Bitmap - - - Returns a bitmap. If the contents is not already a bitmap, the contents are thrown away and a blank bitmap is returned.
Pixmap - - - Returns a pixmap. If the contents is not already a pixmap, the contents are thrown away and a blank pixmap is returned.
PNG - - - Returns a png. If the contents is not already a png, the contents are thrown away and a blank png (TPortableNetworkGraphic - -) is returned.
PNM - - - Returns a pnm. If the contents is not already a pnm, the contents are thrown away and a blank pnm (TPortableAnyMapGraphic - -) is returned.
+.
+Assign - Copies the contents of the given TPicture. Used most often in the implementation of TPicture properties.
+RegisterFileFormat - Register a new TGraphic class for use in LoadFromFile.
+RegisterClipboardFormat - Registers a new TGraphic class for use in LoadFromClipboardFormat.
+UnRegisterGraphicClass - Removes all references to the specified TGraphic class and all its descendants from the file format and clipboard format internal lists.
+Height - The native, unstretched, height of the picture.
+Width - The native, unstretched, width of the picture.
+Graphic - The TGraphic object contained by the TPicture
+Bitmap - Returns a bitmap. If the contents is not already a bitmap, the contents are thrown away and a blank bitmap is returned.
+Pixmap - Returns a pixmap. If the contents is not already a pixmap, the contents are thrown away and a blank pixmap is returned.
+PNG - Returns a png. If the contents is not already a png, the contents are thrown away and a blank png (TPortableNetworkGraphic) is returned.
+PNM - Returns a pnm. If the contents is not already a pnm, the contents are thrown away and a blank pnm (TPortableAnyMapGraphic) is returned.