graphic function ttg_addframe()

ttg_addframe() has no parameters. It draws a rectangle into the target bitmap painting the top and bottom pixel rows and the leftmost and rightmost pixel columns in the color defined with ttg_pen().
If you want to print labels on a page and design each label as an individual bitmap, it might be helpful to firstly use ttg_addgrid() for the whole page (gPrintCoords = 'FULL') and evaluate the position, width and height of the labels. When the labels are designed, a ttg_addframe() will help to check for correct measures and a ttg_addframe() for the page to be printed will show you the correct alignment.
Parameters:
none***************************** | |
* Tool&Task example program * | |
* ttg_addframe() * | |
* last compile: 12.07.2022 * | |
***************************** |
local lx, ly, lxdist, lydist, lpos,ln | |
* the help-image size is 148 * 148 | |
* vertically : 4 rows image height 35 + 8 spaces of 1 pixelrow = 148 | |
* horizontally: 3 columns image width 47 + 7 spaces = 148 | |
* in total 12 images | |
* FoxPro® function transform(number) returns string e.g. "12"=transform(12) | |
* the first 4 letters of the function are sufficient to call it (tran()) | |
ttg_font('G', "Arial", 10, '000', 100, 300, BLUE) | |
for ln = 1 to 12 |
&& the 12 labels |
ttg_new() | |
ttg_createbmp(47, 35, FORMCOLOR) | |
ttg_fontselect('G') |
&& since gTTG_Pixset was reset |
&& show the size of label | |
ttg_text(7, 7, trans(ln)) |
&& first 4 letters specify this function |
ttg_execute(gUserDataTT+"temp\label"+transform(ln)+".bmp") | |
endfor | |
* the 12 images are inserted now | |
ttg_createbmp(148,148, FORMCOLOR) |
&& into the example image |
ly = 0 |
&& starting at top row |
lxdist = 49 |
&& image width + space |
lydist = 37 |
&& image height + space |
lpos = 1 |
&& to count to 12 |
for lrow = 1 to 4 |
&& the 4 rows |
lx = 1 |
&& second pixel column (offset 1) |
for x = 1 to 3 |
&& the 3 columns |
ttg_insertbmp(lx,ly,gUserDataTT+"temp\label"+trans(lpos)+".bmp") | |
lpos = lpos + 1 |
&& next image to insert |
lx = lx + lxdist |
&& next column in this row |
endfor | |
ly = ly + lydist |
&& and the next row |
endfor | |
ttg_execute() |
&& execute the insert-commands |
&& show result in ImageViewer |