Lua:Class:Picture

From Cheat Engine

Jump to: navigation, search

Picture class: (Inheritence: Object)

WARNING: This page may be unfinished.

Contents

[edit] Description

Container for the Graphic class.

[edit] Creation

createPicture() : Picture
Returns an empty picture object.

[edit] Properties

Graphic
PNG
Bitmap
Jpeg
Icon

[edit] Methods

loadFromFile(filename)
Loads an image from a local file.
saveToFile(filename)
loadFromStream(stream[, originalextension])
Loads a picture from a stream. Note that the stream position must be set to the start of the picture.
assign(sourcepicture)
getGraphic()
getPNG()
getBitmap()
getJpeg()

[edit] Examples

-- main interface
local form = createForm()

-- add icon to Form title bar
local pic = createPicture()
pic.loadFromFile("icon.png")
form.Icon = pic.getBitmap()
-- create menu bar for main interface
local menu = createMainMenu(form)
local menu_file = createMenuItem(menu)
menu_file.setCaption("File")
local mi_open = createMenuItem(menu_file)
mi_open.setCaption("Open")

-- add icon to "Open" menu item
local ico_open = createPicture()
ico_open.loadFromFile("data/bitmap/menu/open.png")
mi_open.Bitmap = ico_open.getBitmap()

[edit] See also

[edit] Related Functions

[edit] Related Classes

Personal tools
Toolbox