grafic function ttg_getbmp()
ttg_getbmp opens a .bmp file and checks the structure. If the type of .bmp file cannot be used in TT-Grafics you get an error message. In this case, the function returns "" (blank), otherwise a string is returned giving the width of the image, a '/', the height of the image, a 'B' and the color depth of the image.
the function get_x returns the width of the image from the string returned by ttg_getbmp as integer
the function get_y returns the height of the image from the string returned by ttg_getbmp as integer
If ttg_getbmp reports an error, you may use Check a .BMP file from the menue audio/grafik utilities. This calls form m_chkbmp and analyses the .bmp file providing better information.
Parameters:
1. fullpath of a .bmp file***************************** | |
* Tool&Task example program * | |
* ttg_getbmp() * | |
* last compile: 29.05.2017 * | |
***************************** |
lwh = ttg_getbmp(gUserDataTT + "grafics\tt_pill.bmp") | |
lwidth = get_x(lwh) | |
lheight = get_y(lwh) | |
ttg_font('G', "COURIER NEW", 10, 'N', 100, 300, BLUE) | |
ttg_createbmp(148,148, FORMCOLOR) | |
ttg_fontselect('G') | |
ttg_text(10, 10, "Width...: " + str(lwidth, 3)) | |
ttg_text(10, 30, "Height..: " + str(lheight, 3)) | |
lwo = at("B", lwh) | |
ldepth = val(substr(lwh, lwo+1)) | |
ttg_text(10, 50, "Depth...: " + str(ldepth, 3)) | |