Importing a picture and using it in an Animation?
Author |
Message |
revangrey
![](http://compsci.ca/v3/uploads/user_avatars/1728163034b9c3dc073ae5.jpg)
|
Posted: Fri Jan 02, 2009 8:04 pm Post subject: Importing a picture and using it in an Animation? |
|
|
now I am trying to place a picture in an animation and make that picture move
I was thinking of a Santa in a sleigh making a run across the screen sort of thing
but before I can do that I need to import a picture,
.jpg preferably not those other random things turing supports...
This is what I got from the picture importing thread, by Dan I believe
code: | var varname :int := Pic.FileNew (" c:\Documents and Settings\My Documents\Administrator\My Pictures\spartan6.jpg")
%to specify the exact location of this file
var mypic :int:= Pic.FileNew ("c:\Documents and Settings\My Documents\Administrator\My Pictures\spartan6.jpg")
%to draw the picture in the center of the screen with no mode
Pic.Draw (mypic, maxx div 2, maxy div 2, 0) |
Any and ALL help is appreciated thanks in advance! |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Fri Jan 02, 2009 8:14 pm Post subject: RE:Importing a picture and using it in an Animation? |
|
|
importing and using an image of any supported type works the same way. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Fri Jan 02, 2009 8:16 pm Post subject: RE:Importing a picture and using it in an Animation? |
|
|
Put the image into the folder your code is contained in. That way you don't have to type the whole directory.
code: |
Pic.FileNew ("sparten6.jpg")
|
I don't know if Turing does this, but many languages use the backslash ('\') as an escape character, meaning it does things to the string . To get around that, use a double backslash ('\\').
Another thing, if you create the picture when you initialize the variable, you don't need :int. You can just do:
code: |
var mypic := Pic.FileNew ("sparten6.jpg")
|
Either should work. |
|
|
|
|
![](images/spacer.gif) |
revangrey
![](http://compsci.ca/v3/uploads/user_avatars/1728163034b9c3dc073ae5.jpg)
|
Posted: Fri Jan 02, 2009 8:16 pm Post subject: Re: Importing a picture and using it in an Animation? |
|
|
ARGH
didnt see you post that sry. |
|
|
|
|
![](images/spacer.gif) |
|
|