
-----------------------------------
Kenster102.5
Wed Dec 20, 2006 6:59 pm

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

-----------------------------------
Prince Pwn
Wed Dec 20, 2006 7:33 pm


-----------------------------------
Start by making the variable for the picture:
var backgroundPic : int

Then make it equal to the directory of your picture. eg:
backgroundPic := Pic.FileNew("C:/Documents and Settings/"+Sys.getUserName+"/My Documents/My Pictures/background.bmp")

Now to draw it, put it inside your main loop before you draw anything alse and do:
Pic.Draw(backgroundPic,x,y,picCopy)

-----------------------------------
Prince Pwn
Wed Dec 20, 2006 7:36 pm


-----------------------------------
X and Y are also usually 0 when making a background picture, and you can also use picMerge in place of picCopy if you wish to blend it in with stuff beneath it, which doesn't really matter if that's your background image.

-----------------------------------
Bunny_Man_OC
Wed Dec 20, 2006 7:50 pm


-----------------------------------
backgroundPic := Pic.FileNew("C:/Documents and Settings/"+Sys.getUserName+"/My Documents/My Pictures/background.bmp")

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

backgroundPic := Pic.FileNew ("backgroundPic.bmp")
Pic.Draw (backgroundPic,0,0,picCopy)

-----------------------------------
ericfourfour
Wed Dec 20, 2006 10:01 pm


-----------------------------------
Start by making the variable for the picture:
var backgroundPic : int

Then make it equal to the directory of your picture. eg:
backgroundPic := Pic.FileNew("C:/Documents and Settings/"+Sys.getUserName+"/My Documents/My Pictures/background.bmp")

With the above poster's code this can be reduced further to:
var backgroundPic := Pic.FileNew ("backgroundPic.bmp")
Turing will figure out the data type for you (as long as it is predefined).
