| cmd_newpic | Function (ROM Call 0x365)

AMS 1.01 or higher | bascmd.h

void cmd_newpic (ESI Matrix, SYM_STR PicName, ESI MaxRow, ESI MaxCol);

Executes TI-Basic 'NewPic' command.

cmd_newpic creates a new TI-Basic PIC variable based on data from a matrix on the expression stack (see TI-Basic manual for more info). The parameter Matrix should point to the tag of an n x 2 matrix on the expression stack (its elements must be integer items). Each row in the matrix represents a pixel. Pixel coordinates starts at (0,0). PicName should point to the variable tag of the symbol (i.e. TI-Basic variable) which will be created (see SYMSTR). If the symbol already exists, cmd_newpic replaces it. The parameters MaxRow and MaxCol should point to two integer items which determine the height and the width of the created PIC variable, i.e. the maximum boundary limits for it. Optionally, either MaxRow or MaxCol may point to END_TAG. In this case, default values will be used, which are determined from the minimum area required for the matrix values.
This function may cause heap compression.

Uses: ER_catch, ER_success, ER_throwVar, GetValue, next_expression_index, DerefSym, VarStore, MakeWinRect, WinBitmapGet, WinBitmapSize, WinOpen, WinPixSet, WinRemove