I know that to change the background colour of a graphics window in SmallBasic you can use this:
GraphicsWindow.BackgroundColor = "Green"
But is it possible to make the background an image from my computer?
Thanks.
I know that to change the background colour of a graphics window in SmallBasic you can use this:
GraphicsWindow.BackgroundColor = "Green"
But is it possible to make the background an image from my computer?
Thanks.
Sure! The simplest way of doing that would be to just draw an image on the graphics window at position 0, 0 (top left):
GraphicsWindow.DrawImage("Path/To/Image.png", 0, 0)
You may also want to resize either the image, or the graphics window to make their sizes match:
GraphicsWindow.Width = imageWidth
GraphicsWindow.Height = imageHeight
Zock77 has a good way to do this without any extensions, but if you want the image to resize depending on the size of the window, to make it feel more like the background really is the image, you can use the LitDev extension and the LDGraphicsWindow.BackgroundImage(imageListImage)
command. Here is the code you could use:
image = ImageList.LoadImage("filepath")
LDGraphicsWindow.BackgroundImage(image)
The first line gets an image from a file and saves it to the image variable.
The second sets the background image to the image.
If you don't want to download litdev then use Zock77's method as it is the best alternative to Litdev.
Hope this helped!