Resources

R

Ricardo Furtado

I want to insert an image in a resource that i have in my project.
My resource is:
my.Resources.ResCeph
but i'm not beeing able to insert the image in that resource.
The code i'm using is this:

Dim img As Image
Dim rsxw As ResXResourceWriter
Dim strImg As String = "XPTO"

img = Image.FromFile(strImageLocation)
rsxw = New ResXResourceWriter("ResCeph.resx")
rsxw.AddResource(strImg , img)
rsxw.Close()


I've been trying to find a way to change the line
rsxw = New ResXResourceWriter("ResCeph.resx")
into something like
rsxw = New ResXResourceWriter(my.Resources.ResCeph)
but i'm not being able to do it.

Is there any way to insert the image in the resource
my.Resources.ResCeph
?

My thanks in advanced
 
A

Armin Zingler

Ricardo Furtado said:
Is there any way to insert the image in the resource
my.Resources.ResCeph
?

Resources are designed to be read-only. However, you can write new resx
files and link them the next time you build an assembly. If you need
dynamic data, use a database or a configuration file or whatever.


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top