Retrieve images from embedded resource file not their own files

How to access images in resx file after added to project resource file

Page 1 of 1

3 Replies - 3205 Views - Last Post: 23 December 2009 - 11:42 AM Rate Topic: -----

#1 DOSrelic  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-December 09

Retrieve images from embedded resource file not their own files

Posted 22 December 2009 - 07:59 PM

:blink: Hi there I have just started with Csharp and wrote a messy but usable memory card game using a folder with all the images of the cards but I really want to be able to store them in the executable via the project resource file. I have loaded the resource file but do not know how to retrieve them to assign them to the newly created card class object. Instead of the line
static Bitmap _back = new Bitmap(AmemoryGame .cardBackFileNames[0]); 
what should I use please? I sort of figured that I would
ResXResourceReader resxReader = new ResXResourceReader(...)
but then realised I didn't even know the name of the file!
Can anyone give me some guidance on how to access my resx resource file images please? :rolleyes: Any knowledgeable help would be greatly appreciated. :^:

Is This A Good Question/Topic? 0
  • +

Replies To: Retrieve images from embedded resource file not their own files

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6033
  • View blog
  • Posts: 23,415
  • Joined: 23-August 08

Re: Retrieve images from embedded resource file not their own files

Posted 23 December 2009 - 08:52 AM

Could this snippet from our own PsychoCoder be helpful?

EDIT: Hmmm...maybe not. Sorry.
Was This Post Helpful? 0
  • +
  • -

#3 DOSrelic  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-December 09

Re: Retrieve images from embedded resource file not their own files

Posted 23 December 2009 - 11:01 AM

Thanks JackOfAllTrades but no it's not really a help as you suspected. Anybody else got a good idea? :) I'm sure that somehow one must utilise a ResXResourceReader somehow surely? :rolleyes:
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6033
  • View blog
  • Posts: 23,415
  • Joined: 23-August 08

Re: Retrieve images from embedded resource file not their own files

Posted 23 December 2009 - 11:42 AM

Best I can do is point you to MSDN's Resources in Applications section. I've recently looking into them, but haven't gotten very far.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1