Unit contains definitions for many fundamental classes and types used in graphic applications
A record holding Data about the current Font
The Operating System Handle for the current Font
The Height (in pixels) if the current Font
The Pitch (in points) of the currentFont
The Style of the Font
Bold, Italic, Strikeout or Underlined
The Character Set of the current Font (expresed as an integer)
The Name (as a string) of the current Font
Default Data
for any new

Font

New TFont instances are initialized with the values in this structure.

About font default values: The default font is chosen by the interfaces depending on the context.

For example, there can be a different default font for a button and a groupbox.

How the Text is to be laid out in the Text Rectangle
At the Bottom, Centre or Top of the available window or box
The Style of the Text to be drawn in a rectangle

The Style of the Text to be drawn in a rectangle

- Alignment : TextRect Only: horizontal alignment
- Layout : TextRect Only: vertical alignment
- SingleLine: boolean; If WordBreak is false then process #13, #10 as standard chars and perform no Line breaking.
- Clipping : boolean; TextRect Only: Clip Text to passed Rectangle
- ExpandTabs: boolean; currently ignored
- ShowPrefix: boolean; TextRect Only: Process first single ampersand per line as an underscore and draw double ampersand as a single ampersand
- Wordbreak : boolean; TextRect Only: If line of text is too long to fit between left and right boundaries, try to break into multiple lines between words
- Opaque : boolean; TextRect: Fills background with current Brush
- Opaque : TextOut : Fills background with current foreground color
- SystemFont: Boolean; Use the system font instead of Canvas Font
- RightToLeft: Boolean; For RightToLeft text reading (Text Direction)

Style of Brush to be used
TProgressEvent - for monitoring the progress of a drawing process
TPortableNetworkGraphic
- a PNG image
Primitive ancestor class, mainly for Delphi compatibility
TGraphicsObject - In Delphi VCL this is the ancestor of TFont, TPen and TBrush.
Since FPC 2.0 the LCL uses TFPCanvasHelper as ancestor.
The Font to be used for drawing Text

Most of the data about the font are dealt with by the protected procedures GetData and SetData which operate on TFontData

Individual properties such as Character Set, colour and size can be accessed in the public area

Font
constructor
Opens a new instance of the class and sets defaults for character set, colour, size etc
Font
destructor
Assign
- copies the

LogFont
or

Source
settings to itself

Method: TFont.Assign

Params: ALogFont: TLogFont or

Source: another font

Returns: nothing

Copies the logfont or source settings to itself
The Character Set to be used by the currentFont
Colour
of the current

Font
Default is the same as the text used for the rest of the Window
The Height of the current Font
Name
of the

Font
Pitch
type of the

Font
Fixed or variable pitch, or Default
Reads or writes a flag to determine pitch type
Font
Size
in pixels
Style
of the

Font
Bold, Italic, Strike out, Underline
Property is a set, so may contain zero or more of the above (if set is empty, Normal font is displayed)
The Data associated with the current Pen
The Operating System Handle associated with the current Pen
The Colour of the curent Pen
The Width in pixels of the current Pen
The Style asociated with the current Pen
The Style asociated with the current Pen
Can take any of the values: psSolid, psDash, psDot, psDashDot, psDashDotDot, psinsideFrame, psPattern,psClear
The current Pen for drawing on the current Canvas
Pen
Constructor
Most of its properties are inherited from the parent class
Pen
Destructor
Most of its properties are inherited from the parent class
Copies the Source Pen to itself
the Operating System Handle for the current Pen
Reads or writes a flag to determine the handle
The Colour of the current Pen
Reads or Writes a flag to determine the colour. Default is black
The Mode for the current Pen
Can take any of the values:
pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy,
pmMergePenNot, pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge,
pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor
Default is pmCopy
The Style of the current Pen
Can be one of the following:
psSolid, psDash, psDot, psDashDot, psDashDotDot, psinsideFrame, psPattern,psClear
Default is psSolid
The Width in pixels of the current Pen
The Data associated with the current Brush
The Operating System Handle associated with the current Brush
The Colour to be used by the current Brush
The Bitmap on which the current Brush is working
The Style to be used by the current Brush
Enumerated type defined in TBrushStyle
The Brush to be used to Paint on the current Canvas
A Brush is typically used to fill an enclosed area on theCanvas with one particular colour or coloured pattern
Assign
- copies a

Source
Brush
to itself
Method: TBrush.Assign
Params: Source: Another brush
Returns: nothing

Copies the source brush to itself
Source
- another

Brush
Brush
constructor
Inherits most of its properties from ancestor Classes
Brush
destructor
Inherits properties to remove

Brush
and frees

Handle
The BitMap associated with the current Brush
Reads or writes a flag to determine the current BitMap
Operating System Handle for this Brush
Reads or writes flag to determine system Handle
The Colour of the current Brush
Reads or writes a flag to determine the Colour. Default is White
Style
of the

Brush
Enumerated type - default Solid
The Data about the current Region on the Screen or Canvas
At present the Region can only be rectangular; the ability to define it as a Polygon is not yet implemented
A defined Region on the screen, in which text is written
TRegionData (in same Unit)
TRegion
constructor
TRegion
destructor
Assign
- copies

Source
to itself
Operating System Handle for this Region
HRGN THandle
The rectangle to be used for clipping text
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
Monitor the progress of the drawing
TGraphic
constructor
Virtual method, so recommend that a constructor be supplied to

override this method in descendant classes
LoadFromFile
- Read the graphic from the file system.
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.
Incorrect file format generates an exception
The name of the file containing the graphic, held as a string
SaveToFile
- Writes the graphic to disk in the file provided.
SaveToFile
- Writes the graphic to disk in the file whose name is provided.
The name of the file to which the graphic will be written
LoadFromStream
- reads graphic data from a stream (e.g.

TBlobStream
)
LoadFromStream
- Like

LoadFromFile
except source is a stream (e.g.

TBlobStream
)
Identity of the stream from which the graphic data are to be read
SaveToStream
- write graphic data to a stream
SaveToStream
- write graphic data to a stream
Identity of the stream to which the graphic data are to be written
LoadFromMimeStream
- reads graphic data from a MIME stream
Load the graphic data from a Lazarus Resource (eg a *.lrs file)
LoadFromClipboardFormat
- Replace the current image with the contents of the clipboard
LoadFromClipboardFormat
- Replaces the current image with the data provided from the clipboard.
If the TGraphic does not support that format it will generate an exception.
Load the data from the clipboard using the format type specified by ClipboardType and the format identifier FormatID
SaveToClipboardFormats
- Converts the image to a clipboard format
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
Identity of the clipboard format
Saves the data to a clipboard of Type ClipboardType using the format FormatID
Gets a list of the MIME types that are supported
Finds the default MIME type
Is this an empty (blank) graphic?
Height
- The native, unstretched, height of the graphic.
Has the graphic been modified?
Event handler for any change in the data
Event handler for monitoring progress of the graphic
Palette
- Color palette of image
Palette
- Color palette of image. Zero if graphic doesn't need/use palettes
Has the palette of colours been modified?
Transparent
- Some parts of the image are not opaque. ie the background can be seen through
Width
- The native, unstretched, width of the graphic.
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 class.

It is not a direct descendant of TGraphic, so you will not see TGraphic listed in the Inheritance chart, but it contains a property Graphic, of type TGraphic, so can contain all the properties of a 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, whereas 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
- 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.
- Jpeg
  - Returns a jpeg. If the contents is not already a jpeg, the contents are thrown away and a blank jpeg (

  TJPegImage
  ) is returned.

Monitor progress of drawing process
TPicture
constructor
TPicture
destructor
Any destructor method defined here will override destructors defined in ancestor classes
LoadFromFile
- Reads a picture from disk
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
The name of the file containing the picture, stored as a string
SaveToFile
- Writes the picture to disk
The name of the file to save the picture, stored as a string
LoadFromClipboardFormat
- Reads the picture from the handle provided in the given clipboard format
LoadFromClipboardFormat
- ToDo: Reads the picture from the handle provided in the given clipboard format.
If the format is not supported, an exception is generated
The identifier for the clipboard format
Reads the picture from a clipboard of type ClipboardType using the format FormatID
SaveToClipboardFormats
- Allocates a global handle and writes the picture in its native clipboard format
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.
Identity of the clipboard format
SupportsClipboardFormat
- Returns true if the given clipboard format is supported by

LoadFromClipboardFormat
Boolean - returns true if format supported
Identity of the clipboard format
Assign
- Copies the contents of the given

TPicture
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
UnRegisterGraphicClass
- Removes all references to the specified

TGraphic
class and all its descendants from the file format and clipboard format internal lists
Clear
- removes the graphic
Bitmap
- Returns a bitmap
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
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
PNG
- Returns a png. If the contents is not already a png, the contents are thrown away and a blank png (

TPortableNetworkGraphic
) is returned
Icon
contained within the picture
Graphic
- The

TGraphic
object contained by the

TPicture
Height
- The native, unstretched, height of the picture
Width
- The native, unstretched, width of the picture
Event handler for any change in the picture
Event handler for monitoring progress in drawing the picture
EInvalidGraphic
- exception handler for an invalid graphic
EInvalidGraphicOperation
- exception handler for invalid graphic operation
TCanvas
- where most of the drawing is performed
TCanvas
is a class that defines a very large number of drawing methods including methods for pen and colour selection, producing shapes and filling them, setting or clearing individual pixels, and producing graphic text.
Canvas
constructor
Canvas
constructor: creates a new instance of the class

TCanvas
Canvas
destructor
Canvas
destructor: removes this instance of

TCanvas
and makes its resources available
Use Arc to draw an elliptically curved line with the current Pen
Method: TCanvas.Arc

Params: ALeft, ATop, ARight, ABottom, sx, sy, ex, ey

Returns: Nothing

Use Arc to draw an elliptically curved line with the current Pen. The values sx,sy, and ex,ey represent the starting and ending radial-points between which the Arc is drawn.
Use Arc to draw an elliptically curved line with the current Pen
Method: TCanvas.Arc

Params: ALeft, ATop, ARight, ABottom, angle1, angle2

Returns: Nothing

Use Arc to draw an elliptically curved line with the current Pen.

The angles angle1 and angle2 are 1/16th of a degree.

For example, a full circle equals 5760 (16*360).

Positive values of Angle and AngleLength mean counter-clockwise while negative values mean clockwise direction.

Zero degrees is at the 3 o'clock position.

Params: x1, y1, x2, y2, StartAngle16Deg, EndAngle16Deg

Use Chord to draw a filled Chord-shape on the canvas.

The angles angle1 and angle2 are 1/16th of a degree. For example, a full circle equals 5760(16*360).

Positive values of Angle and AngleLength mean counter-clockwise while negative values mean clockwise direction. Zero degrees is at the 3 o'clock position.

Alternatively the starting and ending points may be specified as radial points (sx, sy, ex, ey)

Draw a filled-chord shape starting and finishing at the specified angular positions on the circumference
Chord
draws a filled Chord-shape on the canvas
Method: TCanvas.Chord

Params: x1, y1, x2, y2, StartAngle16Deg, EndAngle16Deg

Returns: Nothing

Use Chord

to draw a filled Chord-shape on the canvas. The angles angle1

and angle2

are 1/16th of a degree. For example, a full circle equals 5760(16*360).

Positive values of Angle

and AngleLength

mean counter-clockwise while negative values mean clockwise direction.

Zero degrees is at the 3 o'clock position.
Copies the rectangle found at Source in SrcCanvas to the destination position Dest
Draw a graphic stored in SrcGraphic at the point X, Y
Draws the Graphic stored at SrcGraphic, stretched to fit the dimensions of the destination

DestRec

Ellipse
draws a filled circle or ellipse on the canvas
Method: TCanvas.Ellipse

Params: X1, Y1, X2, Y2

Returns: Nothing
Use Ellipse to draw a filled circle or ellipse on the canvas.
Draws a Line from X1, Y1 to X2, Y2
LineTo
draws a line from the current pen position to the new position:

X1, Y1
Moves cursor to new position X1, Y1 without drawing anything
RadialPie
- draw a filled pie-shaped wedge on the canvas with specified start and end coordinates, and starting and ending angular positions

Params: x1, y1, x2, y2, StartAngle16Deg, EndAngle16Deg: Integer

Use Pie to draw a filled pie-shaped wedge on the canvas.

The angles StartAngle16Deg and EndAngle16Deg are 1/16th of a degree. For example, a full circle equals 5760 (16*360).

Positive values of Angle and AngleLength mean counter-clockwise while negative values mean clockwise direction. Zero degrees is at the 3 o'clock position.

RadialPie
uses

Pie
to draw a filled pie-shaped wedge on the canvas
Method: TCanvas.RadialPie

Params: x1, y1, x2, y2, StartAngle16Deg, EndAngle16Deg: Integer

Returns: Nothing

Uses Pie

to draw a filled pie-shaped wedge on the canvas.

The angles StartAngle16Deg

and EndAngle16Deg

are 1/16th of a degree.

For example, a full circle equals 5760 (16*360).

Positive values of Angle and AngleLength mean counter-clockwise while negative values mean clockwise direction.

Zero degrees is at the 3 o'clock position
Pie
draws a filled Pie-shaped wedge on the canvas
Method: TCanvas.Pie

Params: EllipseX1, EllipseY1, EllipseX2, EllipseY2, StartX, StartY, EndX, EndY

Returns: Nothing

Use Pie to draw a filled Pie-shaped wedge on the canvas. The pie is part of an ellipse between the points EllipseX1, EllipseY1, EllipseX2, EllipseY2. The values StartX, StartY and EndX, EndY represent the starting and ending radial-points between which the Bounding-Arc is drawn.
Polybezier
draws cubic Bezier curves
Method: TCanvas.PolyBezier

Params: Points, Filled, Continous

Returns: Boolean

Use Polybezier

to draw cubic Bezier curves.

The first curve is drawn from the first point to the fourth point with the second and third points being the control points.

If the Continuous flag is TRUE then each subsequent curve requires three more points, using the end-point of the previous Curve as its starting point, the first and second points being used as its control points, and the third point its end-point.

If the continous flag is set to FALSE, then each subsequent Curve requires 4 additional points, which are used exactly as in the first curve.

Any additonal points which do not add up to a full bezier(4 for Continuous, 3 otherwise) are ingored. There must be at least 4 points for an drawing to occur.

If the Filled Flag is set to TRUE then the resulting Poly-Bezier will be drawn as a Polygon.
Polygon
draws a closed, many-sided shape on the canvas, using the value of Pen
Method: TCanvas.Polygon

Params: Points: array of TPoint; Winding: Boolean = False; StartIndex: Integer = 0; NumPts: Integer = -1

Returns: Nothing

Use Polygon

to draw a closed, many-sided shape on the canvas, using the value of Pen

. After drawing the complete shape, Polygon

fills the shape using the value of Brush

.

The Points

parameter is an array of points that give the vertices of the polygon.
Winding

determines how the polygon is filled. When Winding

is True, Polygon

fills the shape using the Winding

fill algorithm.

When Winding

is False, Polygon

uses the even-odd (alternative) fill algorithm.
StartIndex

gives the index of the first point in the array to use. All points before this are ignored.
NumPts

indicates the number of points to use, starting at StartIndex

.

If NumPts

is -1 (the default), Polygon

uses all points from StartIndex

to the end of the array.

The first point is always connected to the last point.

To draw a polygon on the canvas, without filling it, use the Polyline

method, specifying the first point a second time at the end.
Polyline
connects a set of points on the canvas
Method: TCanvas.Polyline

Params: Points: array of TPoint; StartIndex: Integer = 0; NumPts: Integer = -1

Returns: Nothing

Use Polyline

to connect a set of points on the Canvas

. If you specify only two points, Polyline

draws a single line.

The Points

parameter is an array of points to be connected.
StartIndex

identifies the first point in the array to use.
NumPts

indicates the number of points to use. If NumPts

is -1 (the default), PolyLine

uses all the points from StartIndex

to the end of the array.

Calling the MoveTo

function with the value of the first point, and then repeatedly calling LineTo

with all subsequent points will draw the same image on the canvas. However, unlike LineTo

, Polyline

does not change the value of PenPos

.
Writes the Text string at the position X, Y on the canvas and leaves the pen at the end of the text
Writes Text string within a specified rectangle, according to predefined Style
Writes Text string within a specified rectangle, according to predefined Style
The boundaries of the rectangle are specified in ARect
X, Y
specify the starting point for writing the Text within the rectangle
TextStyle
determines whether the text is justified, centered, word-wrapped etc. If the Style argument is omitted, defaults are assumed
Event handler for a change in the canvas
Event handler while canvas is changing
TSharedImage
- base class for reference counted images
Increase reference count
Decrease reference count
Release the handle for this image and free its resources
The number of references to this shared image
Has a handle been allocated for this image?
The place where the actual image of a bitmap is stored

Descendant of TSharedImage for TBitmap.

If a TBitmap is assigned to another TBitmap, only the reference count will be increased and both will share the same TBitmapImage
Release the handle for the bitmap mask
Release the bitmap handle
Is the bitmap image empty?
Find the format for the pixels (ie the number of bits per pixel)
BitmapImage destructor
Determine the type of the bitmap handle
The stream to which the data are to be saved
The type of the stream for saving the data
TBitmap
is the data of an image, and can be loaded from a file, stream or resource in .bmp or .xpm format

TBitmap is the data of an image. The image can be loaded from a file, stream or resource in .bmp (windows bitmap format) or .xpm (XPixMap format)

The loading routine automatically recognizes the format, so it is also used to load the images from Delphi form streams (e.g. .dfm files) or FreePascal/Lazarus form streams (.lfm)

When the handle is created, it is up to the interface (gtk, win32, ...) to convert it automatically to the best internal format. That is why the Handle is interface dependent.

To access the raw data, see TLazIntfImage

BitMap
constructor
BitMap
constructor. The supplied code can

override the definition from ancestor classes
BitMap
destructor
BitMap
destructor. The supplied code can

override the method defined for ancestor classes
Assign
: find out about the Source of the call.
Assign
: find out about the Source of the call. If the

BitMap
data are already in use, the data are shared; if not, a new

BitMap
is produced
Release (remove) the image, freeing the resources used
Is a handle allocated for this bitmap?
Returns TRUE if a handle has been allocated
Is a handle allocated for the bitmap mask?
Returns TRUE if a mask handle has been allocated
Has a colour palette been allocated for this bitmap?
Returns TRUE if a colour palette has been allocated
Create an image in the specified rectangle, using the given bitmap and mask handles
LoadFromDevice
: obtain

BitMap
data from a device with Handle

DC
Checks that the Resource Type specified in the string argument is a valid Lazarus type
Returns TRUE if a valid resource type is found
The target resource type specified as a string
LoadFromStream
: obtains

BitMap
data from a

Stream
LoadFromLazarusResource
: obtain data from a valid Lazarus Resource Stream
LoadFromLazarusResource
: obtain data from a valid Lazarus Resource Stream

Checks for the presence of a valid Lazarus Resource, then uses

LoadFromStream
to acquire the data
ToDo
ToDo
LoadFromMimeStream
- get

Bitmap
data from the specified MIME stream
Gets a list of the supported MIME types for the source file
Finds the default MIME type
Finds the available file extensions
LoadFromXPMFile
: obtain data from file in native

PixMap
format
Masks the bitmap using a transparent colour
Saves bitmap data to a stream
Reads data from a stream
Writes data to a stream
Release the bitmap handle, effectively freeing resources
Release the current palette
Get the appropriate FPReader for the given file extension
Get the default FPReader
Get the default FPWriter
Read Bitmap data from stream using the FPImage reader
Write bitmap data to a native stream
Create an interface image
The canvas on which this bitmap is drawn

The Canvas is where all the drawing and painting is performed.

The properties are described in TCanvas

The operating system Handle ssociated with this bitmap
The type of system handle
The system handle associated with the bitmap mask
Whether using monochrome display
PixelFormat - number of bits per pixel
The transparent colour used for masks etc
The mode used for transparency
PixMap
- a class derived from

TBitMap
, with wrapper to deal specifically with PixMaps (ie using 'XPM' format)
PixMap
- Checks that specified resources (PixMap image, File for storage, Stream for writing) are of correct type and format, organises saving and writing
LazarusResourceTypeValid
- checks that specified resource has correct format
Returns True if resource type is 'XPM'
WriteStream
- writes PixMap data to specified stream
True
if size of data in stream has been specified
GetDefaultFPReader
- obtains the correct tool
Returns the correct tool for reading
GetDefaultFPWriter
- obtains the correct tool
Returns the correct tool for writing
A class of Bitmap using the FPImage reader and writer (ie customised for FreePascal)
Find the file extensions for valid bitmap image files
Is the given file extension supported?
Get the FPReader tool appropriate to the given file extension
Get the FPWriter tool appropriate for the given file extension
Get the default FPReader, if no extension-specific tool
Get the default FPWriter, if no extension-specific tool
Read the data from a Stream
Write the data to a stream
Get the default MIME type for this bitmap
TPortableNetworkGraphic
- a PNG image
TIcon
- icons, small images typically associated with applications, controls, etc. Stored in files with .ico extension

TIcon reads and writes .ICO file format.

A .ico file typically contains several versions of the same image.

When loading, the largest/most colourful image is loaded as the TBitmap and so can be handled as any other bitmap. Any other versions of the images are available via the Bitmaps property

Writing is not (yet) implemented.

Bitmaps
- the list of alternative bitmaps (of various sizes)
TIcon
destructor
TIcon
destructor. Method can

override the destructor defined in ancestor classes
Add a bitmap to the current list
Note that Ownership passes to TIcon
ColorToIdent - given a Color value, find its name (Ident) in the look-up table of Colors
Returns True if there is a valid entry in the Colors look-up table
the Color value to be sought in the look-up table
Ident
- the name of the supplied

Color
as found in the look-up table of

Colors
IdentToColor
- given a colour identifier (name) returns the colour value
Returns True if Ident is part of a valid entry in the look-up table of Colors
Ident
- the suppied name for the required

Color
The Color returned from the look-up table, with the name supplied in Ident
SysColorToSysColorIndex
- if Color is one of the system colours, returns the Index of the system colour
If Color is not a system color, returns -1
Returns the Index value of the Color if it is a system colour, otherwise returns -1
The Color for processing
ColorToRGB
- given a

Color
value, converts into

RGB
Returns the original Color transformed to RGB
The original Color for processing
ColorToString
- given a colour value, returns a corresponding colour name like 'Green'
Returns the name of the colour, expressed as a string (like 'Green')
The Color value for processing
StringToColor
- given a colour name like 'Blue', returns the corresponding colour value
Returns the colour corresponding to the name in String S
S
- the name of the required colour, expressed as a string
Finds the Blue component of the supplied colour
Returns the Blue component of the colour specified in RGB
The colour for processing, expressed as a RGB value
Finds the Green component of the supplied colour
Returns the Green component of the colour specified in RGB
The colour for processing, expressed as RGB
Finds the Red component of the supplied colour
Returns the Red component of the colour specified in RGB
The colour for processing, expressed as RGB
RedGreenBlue
- decomposes a composite colour into its component Red, Green and Blue values
The colour for processing, expressed as RGB
The Red component of the colour defined in RGB
The Greencomponent of the colour defined in RGB
The Blue component of the colour defined in RGB
FPColorToTColor
- converts a colour specified as a

FPColor
to a colour of type

TColor
Returns the colour specified in FPColor as a colour of type TColor
The colour for processing, expressed as a FPColor
TColorToFPColor
- converts a colour of type

TColor
to one specified as a

FPColor
Returns the colour specified as a FPColor
c
- the supplied colour specified as type

TColor
Check that the Resource specified for reading or writing is a valid type - result True if it is
The Resource type which is to be checked
Load the graphic data from a resource identified by the name ResName with the Handle 'Instance'
Load graphic data from a resource identified by the integer identifier ResID
Loads picture from a named data stream with a specified file extension
Finds a graphic class with the named file extension Ext, returning an exception if not found
Jpeg
- returns a JPEG image

Jpeg - returns a JPEG image

If the contents is not already a JPEG image, the contents are thrown away and a blank JPEG is returned

PNM
- a

PortableAnyMapGraphic image

PNM - a

PortableAnyMapGraphic image

Reads a PNM image. If it is not a valid PNM image, the contents are thrown away and a blank PNM is generated

TJPEGImage
- a class for handling images stored in JPEG (compressed) format

JPEG images are very commonly used for storing digital photographs. They can represent detailed colour photos using a high degree of compression, resulting in very efficient storage, though with some loss of quality.

The properties CompressionQuality (an integer between 1 and 100, with 100 representing the best quality) and Performance (an enumerated variable with two states: BestQuality or BestSpeed ie compression) can be used to determine the balance between efficiency of storage and quality of picture.

Initialise the FreePascal Image reader for this image type
Finalise the FreePascal Image reader
Initialise the FreePascal Image Writer for this image class
Determine the compression quality for this image

Extreme compression can lead to loss of quality at the expense of a small file size

Allowed range is 1..100

100 = best quality, 25 = pretty awful

Is this a grayscale image?
Is progressive encoding used for this JPEG?
Set for best quality or best speed
LoadFromIntfImage
- gets

Bitmap
data from an interface image
Finds the type of resource for the bitmap
Sets handles for the bitmap and its mask
Release the bitmap mask handle
Determine whether this instance of the class can read graphic streams
Free the colour palette used for this bitmap
Release the handle for the bitmap mask
Reklease the handle for the colour palette
The canvas for the bitmap (ie the actual contents of the picture)
The class of stream for saving data
Monitoring the progress of drawing a complicated Graphic

TProgressEvent is a generic progress notification event which may be used by

TGraphic classes with computationally intensive (slow) operations, such as loading, storing, or transforming image data.

Event params:

Stage

Indicates whether this call to the OnProgress event is to prepare for, process, or clean up after a graphic operation. If OnProgress is called at all, the first call for a graphic operation will be with Stage = psStarting, to allow the OnProgress event handler to allocate whatever resources it needs to process subsequent progress notifications. After Stage = psStarting, you are guaranteed that OnProgress will be called again with Stage = psEnding to allow you to free those resources, even if the graphic operation is aborted by an exception. Zero or more calls to OnProgress with Stage = psRunning may occur between the psStarting and psEnding calls.

PercentDone | The ratio of work done to work remaining, on a scale of 0 to 100. Values may repeat or even regress (get smaller) in successive calls. PercentDone is usually only a guess, and the guess may be dramatically altered as new information is discovered in decoding the image. The value of this property could usefully be passed to a ProgressBar to show the user how drawing is progressing

RedrawNow

Indicates whether the graphic can be/should be redrawn immediately. Useful for showing successive approximations of an image as data is available instead of waiting for all the data to arrive before drawing anything. Since there is no message loop activity during graphic operations, you should call Update to force a control to be redrawn immediately in the OnProgress event handler. Redrawing a graphic when RedrawNow = False could corrupt the image and/or cause exceptions.

Rect | Area of image that has changed and needs to be redrawn.
Msg | Optional text describing in one or two words what the graphic class is currently working on. Ex: "Loading" "Storing" "Reducing colors". The Msg string can also be empty. Msg strings should be resourced for translation, should not contain trailing periods, and should be used only for display purposes. (Do not use the construct: if Msg = 'Loading' then...)

RGBToColor
- assembles the supplied values for Red, Green and Blue into a composite colour
LoadCursorFromLazarusResource
- loads a named cursor handle from the Lazarus Resource (.LRS)
CreateBitmapFromLazarusResource
- creates a bitmap image using data read into a stream from a Lazarus Resource (.LRS)
InvertColor
- returns the complementary colour to the supplied value - helps to produce a 'negative' image
DecColor
- decrease the component RGBs of a colour by the quantity specified (usually results in a darker colour overall)
TCustomBitMap
- the base class for

TBitmap
TPortableAnyMapGraphic
- a PAM graphic image
TCustomBitmapImage
- the base type for

TBitmapImage
Release the handle for the bitmap mask
Free the colour palette used for this bitmap
Release the bitmap handle
Returns True if bitmap handle is correctly released
Release the handle for the bitmap mask
Returns True is mask handle was correctly released
Release the handle for the colour palette
Returns True if palette was correctly released
Is the bitmap image empty?
Returns True if bitmap is empty
Find the format for the pixels (ie the number of bits per pixel)
BitmapImage destructor
Determine the type of the bitmap handle
The canvas for the bitmap (ie the actual contents of the picture)
The stream to which the data are to be saved
The type of the stream for saving the data
The class of stream for saving data
Draw the bitmap on the specified Canvas at the specified coordinates
The canvas on which the bitmap is to be drawn
The rectangular coordinates where the canvas containing the bitmap is located
BitMap
constructor
BitMap
constructor. The supplied code can

override the definition from ancestor classes
BitMap
destructor
BitMap
destructor. The supplied code can

override the method defined for ancestor classes
Assign
: find out about the

Source
of the call.

Assign: find out about the

Source of the call.

If the BitMap data are already in use, the data are shared; if not, a new BitMap is produced

The Source control (usually a Bitmap) for the Assign procedure
Releases all the resources used for the image that is being discarded
Is a handle allocated for this bitmap?
Returns True if a handle is allocated
Is a handle allocated for the bitmap mask?
Returns True is a mask handle has been allocated
Has a colour palette been allocated for this bitmap?
Returns True if a palette has been allocated
Create an image in the specified rectangle, using the given bitmap and mask handles
Checks that the Resource Type specified in the string argument is a valid Lazarus type
Returns TRUE if a valid resource type is found
The target resource type specified as a string
Load a bitmap from the nominated Device
The handle for the device from which the bitmap is to be loaded
Load a bitmap from a stream
The stream from which the bitmap is to be loaded
Load a bitmap from a MIME type stream
The stream from which the bitmap is to be loaded
The MIME type of the stream from which the bitmap is to be loaded
Load a bitmap from a Lazarus interface image
The Lazarus interface image from which the bitmap is to be loaded
Load a bitmap from a XPM file (pixmap)
The name of the file from which the bitmap is to be loaded
Saves bitmap data to a stream
Gets a list of the supported MIME types for the source file
Finds the default MIME type
Finds the type of resource for the bitmap
Finds the available file extensions
Masks the bitmap using a transparent colour
Sets handles for the bitmap and its mask
Reads data from a stream
Writes data to a stream
Release the bitmap handle, effectively freeing resources
Returns True if handle has been correctly released
Release the bitmap mask handle
Returns True if the Mask handle has been correctly released
Release the current palette
Returns True if the palette has been correclty released
Get the appropriate FPReader for the given file extension
Get the appropriate FPWriter for the given file extension
Get the default FPReader
Get the default FPWriter
Read Bitmap data from stream using the FPImage reader
Write bitmap data to a native stream
Create an interface image
The Canvas on which this bitmap is drawn

The Canvas is where all the drawing and painting is performed.

The properties are described in TCanvas

The operating system Handle ssociated with this bitmap
The type of system handle
The system handle associated with the bitmap mask
Whether using monochrome display
PixelFormat
- number of bits per pixel
The transparent colour used for masks etc
The mode used for transparency
TCursorImage
- an Icon to be used to represent a cursor
HotSpot
- the coordinates of the point to which the cursor refers, and which represents the 'active' position on the current form or canvas
IdentEntry
- checks that a given Entry exists in a Map of colour names

A list of system Colors is specified as a look-up table of indices (Entry) and names (MapEntry)

This function checks that the value in

Entry
is within the permitted range, and returns the data pair

Value
,

Name
of the corresponding colour in

MapEntry
.

If Entry is out of range the Result is False

If Entry is out of the range [0..High(Colours)] the Result is returned as False
True if Entry was a valid index into the Colour look-up table
Entry
- a numeric index into the table of colours
MapEntry
- the record of

Value
,

Name
returned from the look-up table of

Colors
Returns the inverse of the original colour (ie a 'negative' effect)
AColor
- the original colour for processing
Returns a copy of the original colour, decremented by a specified amount
AColor
- the original colour for processing
AQuantity
- the amount by which the colour is to be changed
Deprecated - technically a bitmap is created, not loaded
Deprecated - technically a bitmap is created, not loaded
Returns a Bitmap of type TCustomBitMap
AName
- name of the bitmap to be created
AMinimumClass
- optional specifier for class of resource
AHandle
- optional handle supplied for resource
Determine whether this instance of the class can read graphic streams
Class of image processor to be used for reading the bitmap
Returns True if the supplied class is capable of reading graphic streams
EGraphicException
- exception handler for error in graphics
TSharedRasterImage
- a reference counted raster image (may be shared between several controls)
IsEmpty
- checks if there is actually an image at the reference, and returns True if there is not
CreateDefaultHandle
- virtual abstract method for creating a default handle for the shared raster image
BitmapCanvas
- the canvas to be used for painting this bitmap
SaveStream
- the memory stream to be used for saving this image
TRasterImage
- base class for a number of graphic controls, including TCustomBitmap and TCustomIcon, which use a raster of dots to display graphic information
The Canvas on which this raster image is to be painted
HandleAllocated
- if True, an Operating System handle has been allocated
BitmapHandle
- the Handle that has been allocated for the Bitmap
MaskHandle
- the handle that has been allocated for the Bitmap Mask
TransparentColor
- the colour used in transparent mode
In TransparentMode ir is possible to see the underlying objects through the current image
TSharedCustomBitmap
- a reference counted base class for TSharedBitmap, TSharedPixmap, TSharedJPEGImage, TSharedPortableNetworkGraphic and TSharedPortableAnyMapGraphic
ImageAllocated
- returns True if an image has been allocated
HandleType
the type of Bitmap Handle that has been allocated
The Height of the Bitmap
The Width of the Bitmap
TSharedBitmap
- a reference counted Bitmap graphic
TSharedPixmap
- a reference counted Pixmap graphic
TSharedPortableNetworkGraphic
- a reference counted PNG Image
TSharedPortableAnyMapGraphic
- a reference counted shared PAMG
TIconImage
- a primitive Icon class with handles for the Bitmap, Mask and Palette
TSharedIcon
- a reference counted shared Icon
GetImagesClass
- finds which class of icon images is being referenced
Clear
- remove the icon and free its resources
Delete
- remove the icon with specified index
GetIndex
- returns the Index of an image with specified pixel format, height and width
ReleaseHandle
- returns Bitmap handle to Operating system
ReleaseMaskHandle
- returns mask Bitmap handle to operating system
ReleasePalette
- returns Palette handle to operating system
UpdateHandles
- returns True when Bitmap and Mask handles have been updated
Handle
- for the Bitmap
MaskHandle
- Bitmap handle for the Mask
Handle for the Palette
TCustomIcon
- base class for TIcon
Add
- an Icon formatted as AFormat, with specified Height and Width
Clear
the Icon and release its resources
Delete
the indexed Icon
Remove
the Icon specified by AFormat, AHeight and AWidth
GetDescription
- find the description for the Icon
Aindex
- the Index value for the Icon
AFormat
- the Pixel Format for the Icon
AHeight
- the height of the Icon
AWidth
- the width of the Icon
SetSize
- write the size (width, height) of the Icon
GetFileExtensions
- returns a list of valid file extensions associated with the Icon
LazarusResourceTypeValid
- returns True if the specified ResourceType is valid
BitmapHandleAllocated
- returns True if a Bitmap Handle has been allocated
MaskHandleAllocated
- returns True if a Mask Bitmap handle has been allocated
PaletteAllocated
- returns True if a Palette handle has been allocated
SetHandles
- writes the values of the Bitmap and Mask handles
Current
- the sequence number of the current Icon
Count
- the number of references to this Icon
TSharedCursorImage
- a reference counted shared image to be used for cursors
TCursorImageImage
- the image for a cursor, stored as an Icon
HotSpot
- the coordinates of the point to which the cursor refers, and which represents the 'active' position on the current form or canvas
The Operating System Handle allocated for this cursor
TSharedJpegImage
- a reference counted shared image of type JPEG
Add
a reference to the shared icon
Count
- returns the number of references to the shared icon