Jack
Jack

Reputation: 16724

How to add programmatically Images into resources?

I have some image files in my resouces [.resx file] that I have added by using Visual Studio. But, now I need to add the Images programmatically into resource.

How do I this?

Upvotes: 4

Views: 7080

Answers (1)

Angshuman Agarwal
Angshuman Agarwal

Reputation: 4866

Use the ResXResourceWriter.AddResource method for each resource you want to add to the resx file. Use the overloads of this method to add string, object, and binary (byte array) data. If the resource is an object, it must be serializable.

See here for a complete sample - http://msdn.microsoft.com/en-us/library/gg418542.aspx

Upvotes: 6

Related Questions