Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / LoadImage returns an ID for an image file that doesn't exist

Author
Message
dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 11th May 2018 22:57
Just a dumb question, because I don't see it in the documentation, if I LoadImage() with a file that doesn't exist, is it suppose to return an ID?

In 02.05.2018 / MacOS version, I do this:

id = LoadImage("any filename")

Then

id = 100001, GetImageFileName(id) = "any filename", GetImageWidth(id) = 64

Why is this happening?
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 12th May 2018 10:55
I imagine it's the default graphic for a missing image. Can you create a sprite from it?

Not sure though.
puzzler2018
User Banned
Posted: 12th May 2018 11:14
Doesnt Mac and Android require exact filename spelling correct like:-

if the image filename is "\media\Picture.png"

Then

\media\PicTurE.png- wont work
\media\picture.png - wont work
\media\picture.PNG - wont work
\media\Picture.png - should work

I may be wrong though without testing
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 12th May 2018 13:03
if you want agk to catch the error you need to use SetErrorMode(2), otherwise it will likely use the missing media image (the red cross) so the program won't crash.
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 12th May 2018 13:03
Puzzler, I think the question Is if you and load a file that doesn't exist, not spelling it wrong.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 12th May 2018 13:04
Or just do a check before hand using if getfileexists()=1. This is actually just good practice anyway I think.

Login to post a reply

Server time is: 2024-11-18 12:40:18
Your offset time is: 2024-11-18 12:40:18