Computer Science Canada

HELP - Illegal picture ID number '0'. (Probable cause: picture was not successfully created.).

Author:  bijx [ Sun Mar 16, 2014 6:46 pm ]
Post subject:  HELP - Illegal picture ID number '0'. (Probable cause: picture was not successfully created.).

I am trying to import a jpg picture into a test program with the Pic.FileNew command but it always gives me this error:

Illegal picture ID number '0'. (Probable cause: picture was not successfully created.).

I've read other threads with this problem and people keep saying use Pic.Free. I looked it up but i still have no idea what to do with it. This is the code:

code:
var pic:int:=Pic.FileNew("hello.jpg")

Pic.Draw(pic,100,100,0)


I'm using version 4.1.2

Author:  Insectoid [ Sun Mar 16, 2014 7:01 pm ]
Post subject:  RE:HELP - Illegal picture ID number \'0\'. (Probable cause: picture was not successfully created.).

Is the picture in the same folder as your code?

Author:  bijx [ Sun Mar 16, 2014 7:13 pm ]
Post subject:  Re: RE:HELP - Illegal picture ID number \'0\'. (Probable cause: picture was not successfully created.).

Insectoid @ Sun Mar 16, 2014 7:01 pm wrote:
Is the picture in the same folder as your code?


Yes i did, i tried it in the same folder as the file save, and as the program. :/

Author:  Insectoid [ Sun Mar 16, 2014 7:30 pm ]
Post subject:  RE:HELP - Illegal picture ID number \'0\'. (Probable cause: picture was not successfully created.).

Is it possible that your image is actually named 'hello.jpg.jpg'? This actually happens a lot when the operating system hides the extension.

Author:  Tony [ Sun Mar 16, 2014 10:31 pm ]
Post subject:  RE:HELP - Illegal picture ID number \'0\'. (Probable cause: picture was not successfully created.).

alternatively: "hello.jpeg"

Check out the documentation for Dir.Open -- it has an example for printing names of everything in a directory.


: