grafic function ttg_transcolor()

Each system on this world has pros and cons and to remedy the cons, people create workarounds.

ttg_transcolor() is a typical workaround. The complete grafic commands you set for an image are stored in two global variables: gTTG_Pixset and gTTG_Insert.

The first string collects all the grafic commands and the second all bitmaps to insert.

homerg2.dll receives both strings and creates the bitmap you defined by either ttg_createbmp() or ttg_openbmp() and firstly executes gTTG_Pixset and then inserts the bitmaps collected in gTTG_Insert. Now you want to draw a line in one of the bitmaps. Sure, you could open the bitmap first, insert this line and later insert it with the line. In most cases this is not the easy way since your line might cross multiple bitmaps and might also be needed in the space between.

Using ttg_transcolor() defines a color which will not be overwritten when a bitmap is inserted. When you issue ttg_insertbmp(), add 'TT' as last parameter and homerg2.dll will check each pixel in the target before overwriting it with an insert-from-bitmap-pixel. If you use 'TI' instead of 'TT', each pixel in the bitmap is checked on 'transparent color' before it is inserted. The transparent color is saved in the global gTTG_TransColor.

If a second bitmap should not be transparent for the defined color, set 'O' for opaque instead of 'TT' or 'TI'.