Please enable JavaScript to view this site.

KOL/MCK - User Guide

Draw(DC, X, Y) - draws its image on the specified DC context (Device Context of hDC type) from the specified coordinate (X, Y), without changing the scale;

StretchDraw(DC, R) - draws its image on the specified DC device context, fitting it (scaling) into the rectangle R. Additional information: in order for the image scaling to be smooth, it is necessary for the DC to use the API function SetStretchBltMode (DC, halftone);

DrawTransparent(DC, X, Y, C) - draws its image on the DC context similarly to the Draw method, but the C color is considered "transparent" and skipped (that is, the previous image on the device remains untouched at the corresponding points);

StretchDrawTransparent(DC, X, Y, C) - similar to StretchDraw, but assuming the color C is "transparent";

DrawMasked(DC, X, Y, maskBmp) - another version of transparent drawing, in which the maskBmp parameter of type hBitmap is used as a mask (black color in the mask corresponds to transparent areas that will not fall into the target context). This method is faster, and allows you to optimize performance for multiple rendering of the same image, if the mask is prepared in advance;

StretchDrawMasked(DC, R, maskBmp) - similar to the previous one, but after applying the mask, the image is scaled to fit the rectangle R before being displayed on the target context;

Convert2Mask(C) - converts the image into a monochrome mask, assuming C to be a transparent color (the corresponding areas become black, all other pixels in the mask - white);

 

Note that the approach taken in KOL is completely contrary to what is done in this regard in the VCL. But this is not in KOL everything is done upside down, but in the VCL, everything is inside out. There the canvas "draws" graphical objects like TBitmap, ie. it must "know" in advance, at least, about the existence of some abstract progenitor TPicture for all such objects, and refer to its virtual (and in fact, abstract Draw method) to perform this operation. In KOL, neither an abstract method nor a fictitious progenitor is needed for all "drawn" objects, and in general, to draw a graphic object on a canvas, it is not at all necessary to have this canvas encapsulated into an object - it is enough to have a DC descriptor, i.e. just a 32-bit value.

 

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