Computer Science Canada

How the heck...?

Author:  Fail@ICS [ Tue May 18, 2010 9:48 pm ]
Post subject:  How the heck...?

Hey guys I have absolutely no idea how to turn an image into my background on turing.


I used the coding below and still got no result. It epically failed.

var pic : int
pic := Pic.FileNew ("put image name here")
Pic.Draw (pic, 0, 0, picCopy)

Can someone please give me clear instructions on how to make it work. Examples would be nice. I fail at turing Sad

Author:  Tony [ Tue May 18, 2010 9:59 pm ]
Post subject:  RE:How the heck...?

Pic.Draw

Author:  iRobsta [ Tue May 18, 2010 10:05 pm ]
Post subject:  Re: How the heck...?

okay well. all you need is to first declare a picture so you do this :
Turing:

var picture : int :=Pic.FileNew ("PictureName")


Then you need to put the picture in action with this:

Turing:

Pic.Draw (picture,x,y,picCopy)
% The x is your x co-ordinate and the y is your y co-ordinate. You input the co-ordinate's you desire.


all together it's :

Turing:

var picture : int :=Pic.FileNew ("PictureName")
Pic.Draw (picture,x,y,picCopy)


Note: If you want the picture as your background. You need
A) a picture big enough
B) the right screen size
C) if you don't have a picture big enough you can use Turing's scale function which makes it bigger, big distorted your picture.

Author:  TheGuardian001 [ Tue May 18, 2010 10:06 pm ]
Post subject:  Re: How the heck...?

Fail@ICS @ Tue May 18, 2010 9:48 pm wrote:

pic := Pic.FileNew ("put image name here")


Please tell me that line was edited for the purposes of this thread...

Author:  Fail@ICS [ Tue May 18, 2010 10:19 pm ]
Post subject:  Re: How the heck...?

TheGuardian001 @ Tue May 18, 2010 10:06 pm wrote:
Fail@ICS @ Tue May 18, 2010 9:48 pm wrote:

pic := Pic.FileNew ("put image name here")


Please tell me that line was edited for the purposes of this thread...


Lol yes it was:D Thanks soooo much for your help guys but can someone please use an actual image to show me how it's done? I know...I'm a failure.

Author:  iRobsta [ Tue May 18, 2010 10:27 pm ]
Post subject:  Re: How the heck...?

Actual image?
Well you need to save your current programing somewhere. After you have saved it, you save a picture in the same area as the program.
e.g, the desktop, a folder etc.

An example. Lest say I made a program and hit 'Save as', name it, and save it in a new folder i created called 'Picture'. In the picture folder I also put
a picture called 'Mushroom'. It is a picture of a mushroom and it is saved a .jpg like most images.

Now i open the program i just saved. in it there is a code:
Turing:

var mushroompic:int

mushroompic:=Pic.FileNew("Mushroom.jpg") % NOTE! You must add the extention, turing will accept a .jpg, .gif and .bmp files.
Pic.Draw(mushroompic,5,5,picCopy)


There. That simple

Author:  supaphreek [ Fri May 21, 2010 3:01 pm ]
Post subject:  RE:How the heck...?

i thought turing doesnt accept GIF's unless you use sprites? :S

Anyways, heres my way, simple and works Smile

Pic.ScreenLoad (fileName : string, x, y, mode : int)


What this code does is load a picture pretty much.

so, il explain what it does Smile

fileName : string is supposed to be replaced with the path to your file eg "C:/users/blank/desktop/picture.jpg"
(dont forget the quotations)

the x is pretty much your x coordinate from where it will load the image and they y coordinate. Since you want it tload the whole screen, it should be 0, 0.

Finally the last is pic mode, since its going to be a background and if its only going to be loaded once, what i normally use is picCopy Razz

So at the end you have

Pic.ScreenLoad ("C:/users/blank/desktop/picture.jpg", 0, 0, picCopy)


Hope it helped Very Happy


: