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

Username:   Password: 
 RegisterRegister   
 need help turing wont draw a pic
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ali300211




PostPosted: Mon May 11, 2009 8:30 pm   Post subject: need help turing wont draw a pic

What is it you are trying to achieve?
to make the program show the pic aswell as the words


What is the problem you are having?
the pic won't show


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


% Here we select commands by number from a menu
var command,pic1,pic2,pic3,pic4,pic5 : int
loop
    put "Choose from 1-sing, 2-cry, 3-laugh, 4-???, 5-stop : " ..
    get command
    case command of
        label 1 :
            put "la la la"
        pic1:=Pic.FileNew("C:ali/pictures/song.jpg")
Pic.Draw (pic1,25,50,picCopy)
delay(500)
cls
        label 2 :
            put "boo hoo"
        label 3 :
            put "ha ha ha"
        label 4 :
            put "nooooo"
        label 5:
             exit
        label :
          put "I don't understand"
  end case   
end loop
put "That's all folks"




Please specify what version of Turing you are using
Turing 4.1.1
Sponsor
Sponsor
Sponsor
sponsor
DtY




PostPosted: Mon May 11, 2009 8:36 pm   Post subject: RE:need help turing wont draw a pic

You should load the image once, outside of your main loop. It will run much faster.

You might need to tell Turing you want to run in graphics mode, try adding setscreen("Graphics: width,height") at the beginning.
OneTwo




PostPosted: Mon May 11, 2009 8:52 pm   Post subject: RE:need help turing wont draw a pic

The code is fine, as I have just tested it except with a different picture and it shows both text and picture.

Turing:
pic1:=Pic.FileNew("C:ali/pictures/song.jpg")


If your getting an error when you try to run it. Make sure the file path is correct. For example, the current filepath of your file is incorrect in syntax.

It should read "C:/ali/...".

Try to describe more of your problem, like do you just see a blank picture? If so, your filepath might not be right.
DanTheMan




PostPosted: Thu May 14, 2009 8:30 am   Post subject: RE:need help turing wont draw a pic

Don't put the file path in turing. You just have to put the name of the picture and put the picture in the same folder as your file. It's really anal.
Dusk Eagle




PostPosted: Thu May 14, 2009 1:35 pm   Post subject: Re: need help turing wont draw a pic

Umm... putting the file path can be quite useful if the program is located in a different directory than the main program. For instance, if you're creating a tarball for your code, you don't store all your files in the default directory. You arrange them, putting pictures in a child directory. On small projects though, it really doesn't matter whether the pictures are saved in the same directory as the source or not.
DanTheMan




PostPosted: Fri May 15, 2009 8:37 am   Post subject: Re: need help turing wont draw a pic

Dusk Eagle @ Thu May 14, 2009 1:35 pm wrote:
Umm... putting the file path can be quite useful if the program is located in a different directory than the main program. For instance, if you're creating a tarball for your code, you don't store all your files in the default directory. You arrange them, putting pictures in a child directory. On small projects though, it really doesn't matter whether the pictures are saved in the same directory as the source or not.


Okay, thanks for that correction.
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  [ 6 Posts ]
Jump to:   


Style:  
Search: