Class TBGRACompressableBitmap

Unit

Declaration

type TBGRACompressableBitmap = class(TObject)

Description

Class to compress and store the compressed image.

To use it, create an instance with the bitmap you want to compress. You can then free the original bitmap because TBGRACompressableBitmap contains all information necessary to build it again. To construct again your bitmap, call the GetBitmap function.

In this implementation, the memory usage grows during the compression process and is lower only after it is finished. So it is recommended to compress one bitmap at a time.

Hierarchy

Overview

Fields

Public CompressionLevel: Tcompressionlevel;

Methods

Public constructor Create(Source: TBGRABitmap); overload;
Public constructor Create; overload;
Public destructor Destroy; override;
Public function Compress: boolean;
Public function GetBitmap: TBGRABitmap;
Public function UsedMemory: Int64;
Public procedure Assign(Source: TBGRABitmap);
Public procedure ReadFromStream(AStream: TStream);
Public procedure WriteToStream(AStream: TStream);

Properties

Public property Caption : string read FCaption write FCaption;
Public property Height: Integer read FHeight;
Public property Width : Integer read FWidth;

Description

Fields

Public CompressionLevel: Tcompressionlevel;

This item has no description.

Methods

Public constructor Create(Source: TBGRABitmap); overload;

This item has no description.

Public constructor Create; overload;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function Compress: boolean;

Does one step of compression. It does only a part of the work at each call, so you can put it in a loop or in a timer. When it's done, Compress returns false to notify that it did nothing, which means you can stop calling Compress.

Public function GetBitmap: TBGRABitmap;

Constructs the bitmap again, decompressing if necessary. After this, the image is not compressed anymore so the memoy usage grows again and the access becomes fast because there is no need to decompress anymore.

Public function UsedMemory: Int64;

This item has no description.

Public procedure Assign(Source: TBGRABitmap);

This item has no description.

Public procedure ReadFromStream(AStream: TStream);

This item has no description.

Public procedure WriteToStream(AStream: TStream);

This item has no description.

Properties

Public property Caption : string read FCaption write FCaption;

This item has no description.

Public property Height: Integer read FHeight;

This item has no description.

Public property Width : Integer read FWidth;

This item has no description.