
-----------------------------------
ilovelolli
Fri Jun 02, 2006 2:30 pm

how to import images
-----------------------------------
hey i was wondering how to import images thats on ur hard drive


var picID: int
        var x, y : int
        
        picID := Pic.FileNew ("mypic.bmp")
        for i : 1 .. 50
            x := Rand.Int (0, maxx)     % Random x
            y := Rand.Int (0, maxy)     % Random y
            Pic.Draw (picID, x, y, picCopy)
        end for
        Pic.Free (picID)


i know its like that but i dont know what numberrs go where and such,

can someone help me out

-----------------------------------
Cervantes
Fri Jun 02, 2006 3:27 pm


-----------------------------------
If you want an answer, you'll need to ask a question.

You're first sentance indicates that you don't know about Pic.FileNew, yet the code you show says you do.

-----------------------------------
HellblazerX
Fri Jun 02, 2006 5:04 pm


-----------------------------------
Actually, Cervantes, that's the example given in the Turing help manual, so he's probably asking how that piece of code works.  Well, you really only need one of the parts:
var picID : int
picID := Pic.FileNew ("mypic.bmp")
You use Pic.FileNew to load up a new picture from the hard drive, and then store in an int variable.  The other parts are just to randomly draw the image in different positions.

-----------------------------------
ilovelolli
Fri Jun 02, 2006 5:46 pm


-----------------------------------
well where do u put the x and y co-ordinates then?

-----------------------------------
Dan
Fri Jun 02, 2006 6:01 pm


-----------------------------------
well where do u put the x and y co-ordinates then?

You only need x and y co-ordiantes when drawing the pic to the screen using Pic.Draw.


Pic.Draw (picID, x, y, picCopy)


Where x is where the x co-ordinate goses and y is where the y one goses.
