Posted: Mon Jan 23, 2006 2:09 pm Post subject: Import error
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
Tupacalypse_Vinsanity
Posted: 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
Posted: 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.
Posted: 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
Posted: 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
Posted: 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
Posted: Mon Jan 23, 2006 7:16 pm Post subject: (No subject)