The ability to load JPG and PNG files in addition to BMP files
In addition to being able to read BMP graphics files, Liberty BASIC v5.0 can now also read JPG and PNG files into memory and use them for drawing graphics. A new command called LOADIMAGE is added to load any of these three formats: BMP, JPG and PNG as shown in the example below.
'Load different image file formats
examples.
WindowWidth = 200
WindowHeight = 300
open "Test Graphics Commands" for graphics as #draw
#draw down()
call background #draw
call images #draw
#draw flush()
wait
sub background #gr
#gr cls(200, 255, 200)
end sub
sub images #gr
#gr font("arial", 10)
loadimage "globe", "bmp\globe.jpg"
#gr drawimage("globe", 10, 20)
#gr place(10, 18)
#gr color("blue")
#gr "|JPG"
loadimage "title", "bmp\TITLETTT.BMP"
#gr drawimage("title", 10, 100)
#gr place(10, 98)
#gr color("red")
#gr "|BMP"
loadimage "icon", "bmp\lbiconshot.png"
#gr drawimage("icon", 10, 150)
#gr place(10, 148)
#gr color("yellow")
#gr "|PNG"
end sub