Draw a fullscreen window with background

What size do I have to have my "size" to get a background image in fullscreen? The current size of my resolution?

Answers

  • Ops, what size my background image must have? My resolution's size?

  • Answer ✓

    You can use fullScreen() in your setup() function to occupy all your screen.

    Then after you load your image, you can draw it by specifying your screen size which are stored in the sketch's variables width and height like this:

    image(my_loaded_image,0,0,width,height);

    This last statement makes sure your image gets resize to your full screen. If the image is small, it will stretch out. If you image is large (larger than your screen size), it will be scale down. Please notice that the previos code assumes the imageMode is CORNER. Please check the reference for more details about the imageMode. I hope this helps,

    Kf

Sign In or Register to comment.