grafic function ttg_trans2color()

You have a bitmap with a backcolor. Take as an example the big icon on the start screen of Tool&Task. This Bitmap has as backcolor the Tool&Task form color: RGB(255, 243, 197). If you want to insert this bitmap into a printout, it would be preferable to exchange the background against white. The steps are: define the background color as 'transparent' color using ttg_transcolor() and exchange it against white using ttg_trans2color(). The target bitmap you pass to this function can be the name of the source bitmap.

When you click the 'edit header' button in all forms defining a print-page, a program is generated performing exactly the example above.

There is another possibility to achieve this. It involves to set the same 'transparent' color and when inserting the bitmap using ttg_insertbmp() add the parameter 'T' which results in ignoring background pixels. As you can see from the example, the bitmap taken from the tt.exe (oli.bmp) is bigger than what you need for the page header. Hece, there is a ttg_resize() call to get it into the right size before inserting it. This will change the colors of pixels close to the red ellipse of the image and this border will be a bit blurred. Nevertheless, this is also an option.

Parameters:

1: fullpath to source file
2: RED intesity of exchange color
3: GREEN intesity of exchange color
4: BLUE intesity of exchange color
5: fullpath to target file