Please enable JavaScript to view this site.

KOL/MCK - User Guide

HandleType - the type of the bitmap (bmDDB or bmDIB, depending on whether the image is device dependent or independent);

PixelFormat - pixel format (used for HandleType = bmDIB, for bmDDB type stores a special value pfDevice);

BitsPerPixel - calculates the number of bits required to represent one pixel (including for device-specific images);

Handle - descriptor of the system graphic object of the hBitmap type. Device independent images do not need such a descriptor, and in general, all work can potentially be done without allocating such a descriptor. However, if you are working with an image through a canvas, a descriptor for the image is created automatically. It is allowed to assign this property as a value a descriptor of a bitmap (of the hBitmap type) obtained in any way, including from API functions - in this case, the old image is lost and replaced with the assigned one, and the object becomes the "owner" of the assigned descriptor (that is, the descriptor will be automatically destroyed along with the object in its destructor);

HandleAllocated - checks if the handle has been allocated;

ReleaseHandle - separates the descriptor from the image, freeing it (the device-independent image continues to exist in memory, and if it is necessary to perform any operations requiring the presence of the descriptor, it will be allocated again). The descriptor that was detached as a result of such an operation is freed in the sense that it is not known (or of interest) to the TBitmap object from that point on. And then the calling code is responsible for its further fate. For example, it can be deleted by the DeleteObject API function, or used in some other way. It is only important to ensure that there are no leaks of such resources: all allocated GDI resources, which include hBitmap, must be removed when they are no longer needed;

Dormant - detaches the handle from the image, and destroys it (which is equivalent to calling DeleteObject (ReleaseHandle)), and also releases the canvas of the object (RemoveCanvas). This method is recommended to prevent the application from allocating too many GDI resources at the same time if you need to work alternately with a large number of bitmaps in memory;

Assign(srcBmp) - assigns the specified image to the given image, copying it physically (unlike VCL, where copying is postponed until the content of one of the images changes);

 

KOL / MCK User Guide - Created by Carl Peeraer - Diamant Soft, based on the work of Vladimir Kladov - Artwerp.be

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Nav Header: ALT+n
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Exit Menu/Up: ESC