I am posting the code for a very small program called Seamless that takes a small image of a seamless background pattern and repeats it to fill the screen. It lets me collect all the free backgrounds I want, but only expand them to screen size when I intend to use them. This is my first version, which used a PAUSE command to keep the program running long enough for me to take a screen shot of it.
Add some code to create a loop that keeps the full-screen image showing indefinitely, but still lets the user end the program when they want to. The technique must be invisible on the pattern.
Hint: I found a way to do this, but not by using GET TOUCH. It would not detect a screen touch because of the full-screen browser that is displaying the image. You may have a better technique than mine.
The attachments are two: a 225 x 225 pixel seamless image of a circuit board, and the 2048 x 1536 image displayed by Seamless.
Code: Select all
/* /* Seamless by rbytes June 2017 creates a screen-filling texture background from a small texture image. Hundreds of free seamless textures are available on the web. */ ' Turn off the top toolbar, since we want to show as much of our image as possible SET TOOLBAR OFF ' Check the size of the screen. This way the browser window can be defined to exactly fit ' the screen. GET SCREEN SIZE sw,sh ' The browser must have a name given to it N$="seamless" ' Next we create a full-screen browser window. It does not have any interface, ' so it just displays whatever HTML text is given to it. BROWSER N$ URL "" AT 0,0 SIZE sw,sh ' Next we define the HTML text. In the body tag, the background is defined as an image ' to be shown. Notice that wherever I need to insert quote characters, I insert three quotes ' in a row. To make net$ work properly, all sections that contain three quotes ' must be joined to the rest of the string with the & character. net$="<!DOCTYPE HTML><head></head><body background="&"""circuit.jpg"""&"></body></html>" ' Below, we put the HTML string into the browser. Because of the way I defined the ' background image, the browser repeats it horizontally and vertically to fill its ' window. There are other ways to define an image to show it only once, to repeat it ' only horizontally or repeat only vertically. A good site to learn these techniques is ' w3schools.com BROWSER N$ TEXT net$ ' this pause keeps the image on screen just long enough to do a screen capture of it PAUSE 5