Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 how to import images
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ilovelolli




PostPosted: Fri Jun 02, 2006 2:30 pm   Post subject: how to import images

hey i was wondering how to import images thats on ur hard drive

code:

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
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Fri Jun 02, 2006 3:27 pm   Post subject: (No subject)

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




PostPosted: Fri Jun 02, 2006 5:04 pm   Post subject: (No subject)

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:
code:
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




PostPosted: Fri Jun 02, 2006 5:46 pm   Post subject: (No subject)

well where do u put the x and y co-ordinates then?
Dan




PostPosted: Fri Jun 02, 2006 6:01 pm   Post subject: (No subject)

ilovelolli wrote:
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.

code:

Pic.Draw (picID, x, y, picCopy)


Where x is where the x co-ordinate goses and y is where the y one goses.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: