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

Username:   Password: 
 RegisterRegister   
 Import error
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
sensfan




PostPosted: Mon Jan 23, 2006 2:09 pm   Post subject: Import error

coffe
I have tried using the import code in the turing help file. But it won't successfully create the image.

code:
var picID: int
        var x, y : int
       
        picID := Pic.FileNew ("shield_right.bmp")
       
        Pic.Free (picID)


Is there another way to import an image?

Thanks.
Sponsor
Sponsor
Sponsor
sponsor
Tupacalypse_Vinsanity




PostPosted: Mon Jan 23, 2006 4:04 pm   Post subject: ~

You have to specify where the image is, like c:\shield_right.bmp for example

Also i wouldnt use Pic.Free, id make a new variable called pic1 or something, make it an int and do a Pic.Draw

code:

var pic : int := Pic.FileNew ("c:\shield_right.bmp")
Pic.Draw (pic,0,0,picCopy)
Tony




PostPosted: Mon Jan 23, 2006 4:28 pm   Post subject: (No subject)

Pic.Free releases the memory held by the image, as well as internal identifications/pointers. Pic.Free should be used once the image is no longer needed.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
blaster009




PostPosted: Mon Jan 23, 2006 5:12 pm   Post subject: (No subject)

But ONLY when you absolutely don't need it any more. And never when dealing with GUI functions. I hate GUI functions.
MysticVegeta




PostPosted: Mon Jan 23, 2006 5:29 pm   Post subject: Re: ~

Tupacalypse_Vinsanity wrote:
You have to specify where the image is, like c:\shield_right.bmp for example

Also i wouldnt use Pic.Free, id make a new variable called pic1 or something, make it an int and do a Pic.Draw

code:

var pic : int := Pic.FileNew ("c:\shield_right.bmp")
Pic.Draw (pic,0,0,picCopy)


You dont have to specify the folder if the image is in the same folder as your source code.
Rasta Fella




PostPosted: Mon Jan 23, 2006 5:46 pm   Post subject: Re: ~

MysticVegeta wrote:
Tupacalypse_Vinsanity wrote:
You have to specify where the image is, like c:\shield_right.bmp for example

Also i wouldnt use Pic.Free, id make a new variable called pic1 or something, make it an int and do a Pic.Draw

code:

var pic : int := Pic.FileNew ("c:\shield_right.bmp")
Pic.Draw (pic,0,0,picCopy)


You dont have to specify the folder if the image is in the same folder as your source code.


sensfan if you are going to import pictures always good to practice to keep your pictures under the same root folder as your source code. Also just to keep the confusion from getting to your head if you had two pictures under two different folders always specify where you are getting the picture from ,less confusion.
person




PostPosted: Mon Jan 23, 2006 7:16 pm   Post subject: (No subject)

blaster009 wrote:
I hate GUI functions.

then make your own Laughing
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  [ 7 Posts ]
Jump to:   


Style:  
Search: