QBasic/Images

WARNING
NONE of these functions work in IDEs other than QB64.

Simple image
So you were most probably expecting miles of code. And there you have it, all you need to display an image in QB64!

So, what does this astoundingly simple piece of code even do?

A step-by-step explanation:
 * 1) We have DIMed our variable Image as a long value. This is because the image handle returned by the _loadimage function is a long value.
 * 2) x and y are our variables. They hold the values we need to put as the resolution. Thus ,for a 8n00 x 900 image, x = 800 ,y = 900.
 * 3) The image variable Image is next being put the handle values of the image "TEST.jpg". A healthy warning: Keep the image in the folder of the QB64 IDE. Or else, the function won't work!
 * 4) Next, we have resized the screen to fit the image. The newimage function requires three parameters, the resolution parameters and the color mode parameters. Here we have used 32-bit color modes, you can also use 256-bit pallete color modes.
 * 5) Lastly, we put the image using _putimage, which takes the Image variable (our image handle) as its parameter.



Secondary use of _newimage for setting screen details
Well, you must be thinking, all these commands must be used in this exact same order. Nah, that isn't the case. You can use _newimage solo, to set the screen details, like shown below:

This code sets the screen to a massive 1000 x 1000 resolution, with 256-bit palette color modes!