Difference between revisions of "SHIP:Sail:image"

From Serious Documentation
Jump to: navigation, search
Line 42: Line 42:
  
 
== Detailed Description ==
 
== Detailed Description ==
This function takes the image pointed to by the string file and displays it on the canvas in the location resolved by position and offset.  The image will be clipped according to the clip arguments.  Current allowed images are jpeg.
+
This function takes the image pointed to by the string file and displays it on the canvas in the location resolved by position and offset.  The image will be clipped according to the clip arguments.  Current allowed images are jpeg.  An error code of 0 is success.
 
== Examples ==
 
== Examples ==
 
{| class="wikitable" style="margin: 1em 1em;"  
 
{| class="wikitable" style="margin: 1em 1em;"  

Revision as of 08:37, 12 October 2016

Function Returns Introduced Description
image Integer err v5.1.2 Display an image Badge SHIPv5.gif

See Also:

Prototype

Integer err = image(Node canvas, String file, Integer result[, Integer posX, Integer posY, Integer offsetX, Integer offsetY, Integer clipW, Integer clipH]);

Parameters/Return Value

Parameter Data Type Description
canvas Node Canvas to draw on
file String name of file in 8.3 format
result Integer User defined
posX Integer X coordinate on canvas
posY Integer y coordinate on canvas
offsetX Integer x offset to place image
offsetY Integer y offset to place image
clipW Integer image width
clipH Integer image height
Return Integer error code

Detailed Description

This function takes the image pointed to by the string file and displays it on the canvas in the location resolved by position and offset. The image will be clipped according to the clip arguments. Current allowed images are jpeg. An error code of 0 is success.

Examples

Example Results Notes
err = image(homeCanvas, kite.jpg, pResult, 0, 0, ow/2, oh/2, 0, 0); Success Display the pic in the bottom right