Difference between revisions of "SHIP:Sail:image"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|image}}||{{DataType|Integer}} err||style="text-align:center;"|v5.1.2||Display an image {{v5}}</onlyinclude> |} == Se...")
 
Line 9: Line 9:
 
*{{SailFunc|draw}}, {{SailFunc|qr}}
 
*{{SailFunc|draw}}, {{SailFunc|qr}}
 
== Prototype ==
 
== Prototype ==
<code>{{DataType|Integer}} err = {{SailFunc|image}}({{DataType|Node}} canvas, {{DataType|String}} file, {{DataType|Boolean}} &result[, {{DataType|Integer}} posX, {{DataType|Integer}} posY, {{DataType|Integer}} offsetX, {{DataType|Integer}} offsetY, {{DataType|Integer}} clipW, {{DataType|Integer}} clipH]);</code>
+
<code>{{DataType|Integer}} err = {{SailFunc|image}}({{DataType|Node}} canvas, {{DataType|String}} file, {{DataType|Boolean}} *result[, {{DataType|Integer}} posX, {{DataType|Integer}} posY, {{DataType|Integer}} offsetX, {{DataType|Integer}} offsetY, {{DataType|Integer}} clipW, {{DataType|Integer}} clipH]);</code>
  
 
== Parameters/Return Value ==
 
== Parameters/Return Value ==
Line 21: Line 21:
 
|file||{{DataType|String}}||name of file in 8.3 format
 
|file||{{DataType|String}}||name of file in 8.3 format
 
|-
 
|-
|result||{{DataType|Boolean}}||Operation pass/fail
+
|result||{{DataType|Boolean}}||Operation pass/fail pointer
 
|-
 
|-
 
|posX||{{DataType|Integer}}||X coordinate on canvas
 
|posX||{{DataType|Integer}}||X coordinate on canvas
Line 49: Line 49:
 
! scope="col" style="text-align:left" | Notes
 
! scope="col" style="text-align:left" | Notes
 
|-
 
|-
|<code>err = {{SailFunc|image}}(homeCanvas, kite.jpg, &pass, 0, 0, ow/2, oh/2, 0, 0);</code> ||Success||Display the pic in the bottom right
+
|<code>err = {{SailFunc|image}}(homeCanvas, kite.jpg, pResult, 0, 0, ow/2, oh/2, 0, 0);</code> ||Success||Display the pic in the bottom right
 
|}
 
|}
  
 
[[Category:Canvas Functions]]
 
[[Category:Canvas Functions]]

Revision as of 11:16, 11 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, Boolean *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 Boolean Operation pass/fail pointer
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 number of pixels to clip the image width
clipH Integer number of pixels to clip the 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.

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