Difference between revisions of "Lua:createPNG"

From Cheat Engine
Jump to navigation Jump to search
(Initial page creation.)
 
m (Added related function template.)
 
Line 25: Line 25:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local graphic = createPNG(128, 128)
 
local graphic = createPNG(128, 128)
 
-- Draw on or assign the returned graphic.
 
-- Draw on or assign the returned graphic.
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
 +
 +
{{Creation}}

Latest revision as of 23:51, 26 June 2026

<> Lua API Reference

function createPNG(width, height) : PortableNetworkGraphic

Creates a PNG image with the requested dimensions.

Use the returned graphic with Image, Picture, Canvas, or other graphical CE objects.

Function Parameters[edit]

Parameter Type Description
width Integer Width in pixels.
height Integer Height in pixels.

Returns[edit]

PortableNetworkGraphic — The new PortableNetworkGraphic object.

Examples[edit]

1 local graphic = createPNG(128, 128)
2 -- Draw on or assign the returned graphic.

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Basic Visual Controls

Text / Input Controls

Value / Progress Controls

Graphics / Resources

Strings / Streams

Timers / Hotkeys

Scanning / Found Lists

Other Creation Helpers