Resources

  • Thread starter Thread starter Ricardo Furtado
  • Start date Start date
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
 
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
 
Back
Top