OsDrawImage

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
{{Quicklinks}}
+
{{osslfunc|
{| width="100%" style="border: thin solid black"
+
threat_level = None
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
+
|
|- valign="top"
+
function_syntax = <source lang="lsl">
|'''Threat Level''' || None
+
|- valign="top"
+
|'''Function Syntax''' || <source lang="lsl">
+
 
LSL: string osDrawImage( string drawList, integer width, integer height, string imageUrl )
 
LSL: string osDrawImage( string drawList, integer width, integer height, string imageUrl )
 
C#: string osDrawImage( string drawList, int width, int height, string imageUrl )
 
C#: string osDrawImage( string drawList, int width, int height, string imageUrl )
 
</source>
 
</source>
|- valign="top"
+
|
|'''Example(s)||<source lang="lsl">
+
ossl_example = <source lang="lsl">
 
// Example of osDrawImage
 
// Example of osDrawImage
 
default
 
default
Line 26: Line 23:
 
}
 
}
 
</source>
 
</source>
|}
+
|  
Appends an [[Drawing_commands#Image|Image]] drawing command to the string provided in '''drawList''' and returns the result.
+
additional_info = Appends an [[Drawing_commands#Image|Image]] drawing command to the string provided in '''drawList''' and returns the result.
  
 
Retrieves an image specified by the imageUrl parameter and draws it at the specified height and width, with the upper left corner of the image placed at the pen's current position. After the image is drawn, the width and height values are added to the pen's X and Y position, respectively (that is, the pen's current position is set to the lower right corner of the image).  
 
Retrieves an image specified by the imageUrl parameter and draws it at the specified height and width, with the upper left corner of the image placed at the pen's current position. After the image is drawn, the width and height values are added to the pen's X and Y position, respectively (that is, the pen's current position is set to the lower right corner of the image).  
  
 
If imageUrl points to an invalid location, an image type not supported by libgdi, or a non-image MIME type, nothing is drawn. If either or both of the '''width''' or '''height''' parameters are zero or negative, nothing is drawn, but the image is still retrieved.  
 
If imageUrl points to an invalid location, an image type not supported by libgdi, or a non-image MIME type, nothing is drawn. If either or both of the '''width''' or '''height''' parameters are zero or negative, nothing is drawn, but the image is still retrieved.  
 
+
|
[[Category:OSSL Functions]]
+
}}

Revision as of 15:28, 12 June 2011

LSL: string osDrawImage( string drawList, integer width, integer height, string imageUrl )
C#: string osDrawImage( string drawList, int width, int height, string imageUrl )
No descriptions provided
Threat Level None
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
// Example of osDrawImage
default
{
    state_entry()
    {
        string CommandList = ""; // Storage for our drawing commands
        string ImageURL = "http://opensimulator.org/skins/osmonobook/images/headerLogo.png";
        CommandList = osMovePen( CommandList, 0, 0 );                // Upper left corner at <0,0>
        CommandList = osDrawImage( CommandList, 256, 54, ImageURL ); // 200 pixels by 100 pixels
 
        // Now draw the image
        osSetDynamicTextureData( "", "vector", CommandList, "width:256,height:256", 0 );
    }
}
Notes
Appends an Image drawing command to the string provided in drawList and returns the result.

Retrieves an image specified by the imageUrl parameter and draws it at the specified height and width, with the upper left corner of the image placed at the pen's current position. After the image is drawn, the width and height values are added to the pen's X and Y position, respectively (that is, the pen's current position is set to the lower right corner of the image).

If imageUrl points to an invalid location, an image type not supported by libgdi, or a non-image MIME type, nothing is drawn. If either or both of the width or height parameters are zero or negative, nothing is drawn, but the image is still retrieved.

Personal tools
General
About This Wiki