Difference between revisions of "image.copy"

From Inspired-Lua Wiki
Jump to navigation Jump to search
m (Text replace - "| <u>" to "| <u><center>")
Line 19: Line 19:
 
|-
 
|-
  
| <u>image</u> || [[TI.Image]] || The original image.
+
| <u><center>image</u> || [[TI.Image]] || The original image.
 
|-
 
|-
| <u>width</u> || number || The width of the new image
+
| <u><center>width</u> || number || The width of the new image
 
|-
 
|-
| <u>height</u> || number || The height of the new image
+
| <u><center>height</u> || number || The height of the new image
 
|}
 
|}
  

Revision as of 00:41, 31 May 2011

image.copy is a function that is part of image.


The function returns a copy of the input image scaled to fit the specified pixel width and height.
The width and height default to the size of the input image.
The routine raises an error if the new width or height are less than or equal to 0 or greater than 25000.
This routine raises an error if there is insufficient memory to create the new image.


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


Syntax

image.copy(image, width, height)

Parameter Type Description
image
TI.Image The original image.
width
number The width of the new image
height
number The height of the new image

Example

newImage = image.copy(oldImage, 10, 15)

Good to know

To make a relative scale, use

image.copy(image, scaleX * image.width(image), scaleY * image.height(image))

See also