10-29-2011 01:47 AM
I'm working through HelloWorldDisplayManaged to display my own background. I import my file into the same folder as "HelloWorld_smaller_bubble.png". When I change the file name from "HelloWorld_smaller_bubble.png" to my file name, I would expect my image to display as a background as the tutorial did. Instead fopen generates "No such file or directory" and no image is displayed.
I've tried a multitude of paths for the file but nothing works. I'm not sure what I missed. Any suggestions?
Solved! Go to Solution.
10-29-2011 10:33 AM
What you are most likely missing is adding the new image as an asset in your bar-descriptor.xml. If you do not do this, the image won't be packaged in the BAR file resulting in a no such file error.
To add an asset to be packaged in your BAR file, open the bar-descriptor.xml and in the editor go to the Assets page. Select the All Configurations and drag your image file from the project explorer to the assets table.
If you edit the bar-descriptor.xml manually in a text editor add the following asset element inside the root 'qnx' node:
Now in your main.c you can update the line that loads the image to:
bbutil_load_texture("app/native/my_image.png", NULL, NULL, &tex_x, &tex_y, &background)