Computer Science Canada How do I import a picture into my program |
Author: | Kenster102.5 [ Wed Dec 20, 2006 6:59 pm ] |
Post subject: | How do I import a picture into my program |
I am taking computer engineering at school and am wondering how do I import a picture into a program so it acts as a background for the program? Thank you |
Author: | Prince Pwn [ Wed Dec 20, 2006 7:33 pm ] | ||||||
Post subject: | |||||||
Start by making the variable for the picture:
Then make it equal to the directory of your picture. eg:
Now to draw it, put it inside your main loop before you draw anything alse and do:
|
Author: | Prince Pwn [ Wed Dec 20, 2006 7:36 pm ] | ||||
Post subject: | |||||
X and Y are also usually 0 when making a background picture, and you can also use
|
Author: | Bunny_Man_OC [ Wed Dec 20, 2006 7:50 pm ] | ||||
Post subject: | |||||
Prince Pwn wrote:
you can also put the picture in the same folder as the turing program that will be ussing it. if you do this then you simply need to put
|
Author: | ericfourfour [ Wed Dec 20, 2006 10:01 pm ] | ||||||
Post subject: | |||||||
Prince Pwn wrote: Start by making the variable for the picture:
Then make it equal to the directory of your picture. eg:
With the above poster's code this can be reduced further to:
Turing will figure out the data type for you (as long as it is predefined). |