graphic function ttg_pixel()

The Tool&Task Graphic function ttg_pixel() draws one pixel with 'pen color' (see ttg_pen() and ttg_pencolor()). If the coordinates are not integer, they are rounded to integer.
Parameters:
1: x coordinate of pixel2: y coordinate of pixel
***************************** | |
* Tool&Task example program * | |
* ttg_pixel() * | |
* last compile: 12.07.2022 * | |
***************************** |
local ln, lx, ly, lold_x, lold_y | |
ttg_new() |
&& clear TTG globals |
ttg_createbmp(148,148,FORMCOLOR) |
&& Tool&Task FORMCOLOR |
ttg_pencolor(BLUE) |
&& and a blue pen |
for ln = 8 to 140 |
&& whole width was from 0 to 147 |
lx = ln - 74 |
&& x from -66 to + 66 |
ly = 147 - (lx * lx / 30) |
&& 66 * 66 / 30 = 145.2 |
if ln < 74 | |
ttg_pixel(ln, ly) |
&& this leaves spaces |
else | |
ttg_line(lold_x, lold_y, ln, ly) |
&& this doesn't |
endif | |
lold_x = ln | |
lold_y = ly | |
endfor | |
ttg_execute() | |
ttg_display() |