Class TAdBitmap

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TAdBitmap = class(TAd2dBitmap)

Description

TAdBitmap is the main bitmap class

Hierarchy

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure Assign(AGraphic:TObject);
Public procedure AssignAlphaChannel(AGraphic:TObject);
Public procedure AssignTo(AGraphic:TObject);
Public procedure AssignAlphaChannelTo(AGraphic:TObject);
Public procedure LoadFromStream(AStream:TStream);
Public procedure SaveToStream(AStream:TStream);
Public procedure LoadFromFile(AFile:string);
Public procedure SaveToFile(AFile:string);
Public procedure LoadGraphicFromFile(AFile:string; ATransparent:Boolean=true; ATransparentColor:LongInt=0);
Public procedure DrawBitmap(AX, AY: integer; ABmp: TAd2dBitmap; AUseAlpha: boolean = true);

Properties

Public property Compressor: TAdGraphicCompressorClass read FCompressorClass write FCompressorClass;
Public property OnProgress: TAdGraphicProgress read FProgress write FProgress;

Description

Methods

Public constructor Create;

This constructor creates an instance of TAdBitmap.

Public destructor Destroy; override;

This destructor destroys the instance of TAdBitmap and frees the used memory.

Public procedure Assign(AGraphic:TObject);

This procedure assigns a graphic objet by searching a registered TAdGraphicFormat, which can handle this graphic type. If no valid TAdGraphicFormat is found, ENoValidFormat is raised.

Public procedure AssignAlphaChannel(AGraphic:TObject);

This procedure assigns the alpha channel from a graphic objet by searching a registered TAdGraphicFormat, which can handle this graphic type. If the graphic doesn't handel alpha channels, the average RGB value will be used to set the alpha channel of the bitmap. If no valid TAdGraphicFormat is found, ENoValidFormat is raised.

Public procedure AssignTo(AGraphic:TObject);

This procedure assigns a graphic objet by searching a registered TAdGraphicFormat, which can handle this graphic type. If no valid TAdGraphicFormat is found, ENoValidFormat is raised.

Public procedure AssignAlphaChannelTo(AGraphic:TObject);

This procedure assigns the bitmap alpha channel to a graphic objet by searching a registered TAdGraphicFormat, which can handle this graphic type. If the graphic doesn't handel alpha channels, the RGB values of the graphic will be set to the alpha channel value. If no valid TAdGraphicFormat is found, ENoValidFormat is raised.

Public procedure LoadFromStream(AStream:TStream);

This proecdure tries to load the bitmap data by searching a registered TAdGraphicCompressor which may decompress the bitmap data. If no compressor is found, TAdBitmap tries to interpret the specified data as RAW data. If this fails, ENoValidCompressor is raised.

Public procedure SaveToStream(AStream:TStream);

This proecdure stores the bitmap data using the compressor class specified in "TAdGraphicCompressorClass" in a stream. If "Compressor" is nil, the bitmap stores the RAW bitmap data. The RAW-Data header contains the Size of the Bitmap in Byte, and the width/height of the bitmap in pixel. The RAW data is stored in 32-Bit RGBA value pairs starting in the top-left of the bitmap.

Public procedure LoadFromFile(AFile:string);

This procedure tries to load the bitmap data using LoadFromStream and a memory stream from a file.

Public procedure SaveToFile(AFile:string);

This procedure saves the bitmap data using "SaveToStream" and a memory stream in a file.

Public procedure LoadGraphicFromFile(AFile:string; ATransparent:Boolean=true; ATransparentColor:LongInt=0);

This procedure searches for a registered graphic format, that is able to handle the given file. The image type is (currently) only determined by the file extension.

Parameters
ATransparent
specifies whether the picture should be loaded with an transparency channel.
ATransparentColor
Public procedure DrawBitmap(AX, AY: integer; ABmp: TAd2dBitmap; AUseAlpha: boolean = true);

Draws another bitmap to the specified position.

Properties

Public property Compressor: TAdGraphicCompressorClass read FCompressorClass write FCompressorClass;

Set the compressor class you want to use to compress the bitmap data here. If "Compressor" is nil, the bitmap will store the RAW bitmap data.

Public property OnProgress: TAdGraphicProgress read FProgress write FProgress;

This event notifies about the bitmaps decoding/encoding progress.

SourceForge.net Logo


Generated by PasDoc 0.11.0 on 2008-12-31 14:31:58