LOADGRAPHIC

From Liberty BASIC Family
Jump to navigation Jump to search
Not supported in Just BASIC Not supported in Liberty BASIC Not supported in Liberty BASIC 5 Supported in Run BASIC

Description

A graphic image can be loaded simply and directly into a graphic object and rendered.

Syntax

  1. LOADGRAPHIC #handle, path$ - Load an image file from path$ and make a graphic object #handle

Hints

Images loaded with LoadGraphic have the same methods as graphics created with the GRAPHIC statement. You can draw objects and text onto the loaded graphic, retrieve its dimensions and do other things. See GRAPHIC for examples of all graphic methods.

Example

loadgraphic #pic,"public\programmingbanner.JPG"
render #pic
'Now we can also draw on the graphic object.  
'Here is a quick example:

  loadgraphic #picture, "polandboating.jpg"
  howTall = #picture height()
  #picture color("white")
  title$ = "Boating in Poland, 2007"
  xPosition = (#picture width() - #picture stringwidth(title$)) / 2
  #picture place(xPosition, howTall - 14)
  #picture "\";title$
  render #picture

Useful Procedures

' Place a useful function or sub using this keyword here