Silly Resource Loading question


#1

Hi. I’m trying to load a png resource into an Image. In the other frameworks I’ve worked with, the image class is usually capable of loading the image requiring only some kind of resource ID. Under VC8 I have a .rc file with

BACKGROUND PNG DISCARDABLE “…/…/rc/bg.png”

and in the component I want to do something like this:

void MyEditorComponent::paint (Graphics& g)
{
	Image* img = ImageCache::getFromFile(File(T("BACKGROUND"))); 
	g.drawImageAt(img, 0, 0);
}

Of course this doesn’t work, but I’m just trying to clarify what I want to do.

Thanks,
Adam


#2

Have a look at binarybuilder, in the extras folder. It’s a much more cross-platform way of embedding stuff in your exe. I’ve used it in all the example projects.


#3

I noticed that… didn’t know what it was exactly. Will check it out. Thanks!


#4