graphics.loadPNG: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 3: Line 3:
|type = function
|type = function
|name = graphics.loadPNG
|name = graphics.loadPNG
|usage = create a texture object from a stream containing PNG data
|usage = create a texture/surface object from a PNG image [[openFile|file stream]]
|returnTypes = Texture
|returnTypes = Texture
|returnInfo = the texture object
|returnInfo = the texture object
|parameters = Stream stream OR Sting url
|parameters = Stream stream OR String url
|parameter1 = Stream stream The [[ResourceFiles|file stream]] of the PNG file, or String with a URL to a PNG file
|parameter1 = Stream stream The [[openFile|file stream]] of the image, or String with a URL to a PNG file
|returnFail1 = bool false
|returnFail1 = bool false
|notes = The first parameter can be either a [[ResourceFiles|file stream]], or a URL to a file on the internet.<br>
|notes = The first parameter can be either a [[openFile|image]], or a URL to a file on the internet.<br>
When using a URL, the file must be accessible by the '''client'''. The client will use it's own connection to grab the file, which means it must be publicly available.
When using a URL, the file must be accessible by the '''client'''. The client will use it's own connection to grab the file and it must be publicly available.<br>
The texture object created by this function is sometimes referred to as a "surface" like in [[graphics.drawRectangle|graphics.drawRectangle]]
}}
}}

Latest revision as of 23:26, 5 December 2025

Function Client Only icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline

Available since Client 1.0.0

Texture graphics.loadPNG(Stream stream OR String url)

The graphics.loadPNG function is used to create a texture/surface object from a PNG image file stream.

Parameters

1) Stream stream The file stream of the image, or String with a URL to a PNG file.

Return

Texture The texture object.

Notes

  • The first parameter can be either a image, or a URL to a file on the internet.
  • When using a URL, the file must be accessible by the client. The client will use it's own connection to grab the file and it must be publicly available.
  • The texture object created by this function is sometimes referred to as a "surface" like in graphics.drawRectangle.

Examples

There aren't any examples for this function.

Compatibility

There isn't any compatibility information for this function.