graphic function ttg_createbmp()
This is the first Tool&Task Grafic command when you want to start your program with a new bitmap. This image is created according to your parameters.
gTTG_Pixset is clearedgTTG_Insert is cleared
gTTG_Width is set to the width of this bitmap
gTTG_Height is set to the height of this bitmap
gTTG_Source is set to the file name of this bitmap
As all bitmap creating ttg_ commands do, the function returns the width and the height of the bitmap (see functions get_x(), get_y())
Since the complete image of the bitmap is in memory during creation, other commands are executed pretty swiftly. Hence, it makes sense to enter these commands before ttg_createbmp(): Currently (version 2.90) the following commands will be interpreted:
ttg_brush(), ttg_brushcolor(), ttg_pen(), ttg_pencolor(),
ttg_line(), ttg_rectangle().
As an example, when you print many pages for a planner, a common background image can be created (ttg_createbmp) and afterwards this page is opened with ttg_openbmp and the text information or changing images are inserted.
Parameters:
Parameter 1. width of bitmapParameter 2. height of bitmap
Parameter 3. RGB color of background default WHITE = RGB(255, 255, 255)
Parameter 4. filename (fullpath)
***************************** | |
* Tool&Task example program * | |
* ttg_createbmp() * | |
* last compile: 12.07.2022 * | |
***************************** |
lw = 100 | |
lh = 10 | |
ttg_new() | |
ltarget = gUserDataTT + "Temp\" | |
* create a bitmap for all Tool&Task colors | |
ttg_createbmp(lw, lh, FORMCOLOR, ltarget + 'FORMCOLOR.bmp') | |
ttg_createbmp(lw, lh, PAGECOLOR, ltarget + 'PAGECOLOR.bmp') | |
ttg_createbmp(lw, lh, CONTRAST, ltarget + 'CONTRAST.bmp') | |
ttg_createbmp(lw, lh, WHITELINE, ltarget + 'WHITELINE.bmp') | |
ttg_createbmp(lw, lh, GREYLINE, ltarget + 'GREYLINE.bmp') | |
ttg_createbmp(lw, lh, LIGHTBLUE, ltarget + 'LIGHTBLUE.bmp') | |
ttg_createbmp(lw, lh, LIGHTGREEN, ltarget + 'LIGHTGREEN.bmp') | |
ttg_createbmp(lw, lh, LIGHTGREY, ltarget + 'LIGHTGREY.bmp') | |
ttg_createbmp(lw, lh, LIGHTRED, ltarget + 'LIGHTRED.bmp') | |
ttg_createbmp(lw, lh, WHITE, ltarget + 'WHITE.bmp') | |
ttg_createbmp(lw, lh, BLACK, ltarget + 'BLACK.bmp') | |
ttg_createbmp(lw, lh, YELLOW, ltarget + 'YELLOW.bmp') | |
ttg_createbmp(lw, lh, MAGENTA, ltarget + 'MAGENTA.bmp') | |
ttg_createbmp(lw, lh, CYAN, ltarget + 'CYAN.bmp') | |
ttg_createbmp(lw, lh, RED, ltarget + 'RED.bmp') | |
ttg_createbmp(lw, lh, GREEN, ltarget + 'GREEN.bmp') | |
ttg_createbmp(lw, lh, BLUE, ltarget + 'BLUE.bmp') | |
ttg_createbmp(lw, lh, HEADBLUE, ltarget + 'HEADBLUE.bmp') | |
ttg_createbmp(lw, lh, ORIHEAD, ltarget + 'ORIHEAD.bmp') | |
ttg_createbmp(lw, lh, DISBACK, ltarget + 'DISBACK.bmp') | |
ttg_createbmp(lw, lh, ORIBACK, ltarget + 'ORIBACK.bmp') | |
* the following command will open the directory | |
* ltarget in Windows Explorer | |
tt_explorer(ltarget) |