When I attempt to load an image (e.g. backgroundThing.png) that exists in "Extra Resources" via tge GetBinaryResource function, the value returned is a null reference. I have confirmed that the filename is an exact match. I note that the PNG file listed in Extra Resources has a type of "Image".
If I change all of the image filenames to have an underscore suffix (e.g. backgroundThing.png becomes backgroundThing.png_) and then add the file to Extra Resources, the type appears as Binary. Once I make this change, the GetBinaryResource call works perfectly (once I pass the '_' suffixed filename through).
This looks to be by design. However, I'd like to have images in my Extra Resources that I can use to draw to a canvas for use in the module. Is there a preferred way to load these that doesn't require me to mangle the filename?
Extra Resources in Designer not loading via GetBinaryResource
-
- Posts: 49
- Joined: Sun Aug 25, 2019 10:26 am
-
- Posts: 27
- Joined: Sat Oct 20, 2018 9:29 pm
Re: Extra Resources in Designer not loading via GetBinaryResource
Thanks for noticing this, and sorry for the slow reply. GetBinaryResource is currently set up to only retrieve resources of "binary" type; our thinking when we did this was that there are other APIs for retrieving images and audio. But there are obviously good reasons for wanting to use GetBinaryResource to load image & audio resources as well, so we're changing it to be able to load all types of resources. This fix should be in the next release.
-
- Posts: 49
- Joined: Sun Aug 25, 2019 10:26 am
Re: Extra Resources in Designer not loading via GetBinaryResource
Awesome news - thank you!