gc:drawImage

From Inspired-Lua Wiki
Revision as of 15:49, 17 December 2013 by Adriweb (talk | contribs) (→‎Example)
Jump to navigation Jump to search

drawImage is a function that is part of gc.

This has been introduced in TI-Nspire OS 3.0 (Changes).


Syntax

gc:drawImage(image, x, y)

Parameter Type Description
image
TI.Image The image to display
x
number the x coordinate of the upper-left corner of the image
y
number the y coordinate of the upper-left corner of the image


Example

-- for ApiLevel < 2.3 (OS < 3.6) :
imgSRC = "\002\000\000\000\002\000\000\000\000\000\000\000\004\000\000\000\016\000\001\000\255\255\255\255\255\255\255\255"
img = image.new(imgSRC)

-- Or, for ApiLevel >= 2.3 (OS >= 3.6) :
img = image.new(_R.IMG.img_1)

function on.paint(gc)
    gc:drawImage(img, 0, 0)
end

See also