Difference between revisions of "Lua:Class:Picture"
Jump to navigation
Jump to search
AntumDeluge (talk | contribs) (→Examples: Add example for assigning an image to a menu item) |
AntumDeluge (talk | contribs) m (→Methods) |
||
Line 40: | Line 40: | ||
: | : | ||
− | ; getGraphic | + | ; getGraphic() |
: | : | ||
− | ; getPNG | + | ; getPNG() |
: | : | ||
− | ; getBitmap | + | ; getBitmap() |
: | : | ||
− | ; getJpeg | + | ; getJpeg() |
: | : | ||
Revision as of 08:16, 7 February 2019
Picture class: (Inheritence:)
WARNING: This page is unfinished.
Contents
Creation
- createPicture() : Picture
- Returns a newly created Picture.
Properties
- Graphic
- PNG
- Bitmap
- Jpeg
- Icon
Methods
- loadFromFile(filename)
- Loads an image from a local file.
- saveToFile(filename)
- loadFromStream
- assign
- getGraphic()
- getPNG()
- getBitmap()
- getJpeg()
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()