Changes

Jump to navigation Jump to search

gc:drawImage

142 bytes added, 16:49, 17 December 2013
Line 16: Line 16:  
| <u><center>y</center></u> || number || the y coordinate of the upper-left corner of the image
 
| <u><center>y</center></u> || number || the y coordinate of the upper-left corner of the image
 
|}
 
|}
 +
    
== Example  ==
 
== Example  ==
 
<syntaxhighlight>
 
<syntaxhighlight>
 +
-- 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"
 
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)
 
img = image.new(imgSRC)
drawImage(img, 0, 0)
+
 
 +
-- 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
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Navigation menu