TBzImgCache component for Delphi3 ver 1.00
by Vladimir Kladov (Mr.Bonanzas).
------------------------------------------
This component is based on TBzImgCollection
component which allows to store and operate
with images of different size (width,height)
using two big bitmaps. TBzImgCache is intended
to provide access to set of images from hard
disk recently accessed. It could speed up Your
Delphi application if it uses different images
from hard disk and requests them in random
order. To use this component You need to have
TBzImgCollection component already installed.

Properties and methods:

DESIGN-TIME PROPERTIES:
ImgCollection : TBzImgCollection; - set it to start working with cache.
TestFileTime : Boolean; (Default True); - set it to False to prevent
	testing file time (this may speed up program but cache could
	return older version of image already stored in collection);
MaxImages : Integer; (Default 100); - maximum of images to store in
	cache. If MaxImages + 1 added, the older image is deleted from
	cache.
EnableInners : Boolean; (Default True) - enables allocate more images
	in collection than it is set by MaxImages property if there is
	possible to allocate place for storing them without expanding
	the collection bitmap.

RUN-TIME PROPERTIES:
Count : Integer; (Read only) - number of images stored in collection
	using this cache component. Important: ImgCache supposes that
	TBzImgCollection never does shift images in number order even
	deleting entries. So, if You know index of image in cache, then
	You You also know index of image in collection (the same one).
Names[ Idx : Integer ] : String; - filenames [usually] of stored
	images. You can change it using ImgCollection.Names[ ] property.
LockCount[ Idx : Integer ] : Integer; Read only - how many times image
	was been locked to prevent releasing of it from cache.
ImgFileTime[ Idx : Integer ] : TFileTime; - Last write time of file
	from which image was loaded. Is used to test filetime and reload
	image changed on disk (if TestFileTime = True).
ImgData[ Idx : Integer ] : Pointer; - User data associated with image.
	Must be allocated using GetMem. When image is released this memory
	is freeing automatically.

METHODS:
Create( Aowner : TComponent ); - constructor.
Destroy; - destructor.
Clear( DeleteImages : Boolean ); - clear cache and release locked images.
	If DeleteImages = False, images are not deleted from collection.
KEY FUNCTION:
GetImage( FileName : String; // Full path to image file
	   Lock : Boolean; // If TRUE then lock it if loaded or found in cache
	   NotifyProc : TNotifyEvent // Procedure to callback when image is
					  // deleted (may be nil)
	   ) : Integer; // Returns index of loaded or found image in cache
LockImg( Idx : Integer; FileName : String ) : Boolean; - lock image on index
	Idx. FileName must match its name stored in collection (this parameter
	is to ensure You mean certain image and not something other). Returns
	False if operation failed (name does not match).
UnlockImg( Idx : Integer );
StoreImage( Img : TBitmap; FileName : String; Lock : Boolean; NotifyProc :
	TNotifyEvent ) : Integer; - store bitmap as image with name 'FileName'.
	You may use this method to store images loaded by yourself.
StoreIcon( Icon : TIcon; FileName : String; Lock : Boolean; NotifyProc :
	TNotifyEvent ) : Integer; - store icon to cache and assign 'FileName'
	to correspondent entry in cache.
StoreMasked( Img, Mask : TBitmap; FileName, Lock, NotifyProc ) : Integer;

INSTALLATION.
	To make size of archive smaller I do not include packages and
	You have to add this component to package with TBzImgCollection
	component:
1. Extract files into directory of Your choice, i.g. C:\Components
2. Open package, containing TBzImgCollection component.
3. Add BzImgCacheReg.pas, compile and install it.

LEGALITY
This component is FREE for USE by any way You wish. But source only by
purchasing of TBzImgCollection component.

Disclaimer of Warranty
----------------------

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE PROVIDED "AS IS" AND
WITHOUT WARRANTIES OF ANY KIND WHETHER EXPRESSED OR IMPLIED.

In no event shall the author be held liable for any damages whatsoever,
including without limitation, damages for loss of business profits,
business interruption, loss of business information, or any other loss
arising from the use or inability to use  the software.

To get more information please visit my Web page:
http://members.xoom.com/mr_bonanzas

To contact me mailto:mr_bonanzas@usa.net 
with Subject: BzImgCollection, BzImgCache
