Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The ResX Generator (ResXGen) is a console utility that converts an image file (such as a .jpg or .bmp file) into an XML-formatted .resx file, which can then be compiled into a .NET-compatible .resources files using Resgen.exe.
The following lines of code from ResXGen (abridged for readability) show the essential process for creating a .resx file from an image file.
Image img = Image.FromFile(ap.InputFile);
ResXResourceWriter rsxw = new ResXResourceWriter(ap.OutputFile);
rsxw.AddResource(ap.ResourceName, img);
rsxw.Close();
The necessary XML schema is documented in the .NET Framework — specifically, in the ResourceSchema property of the ResXResourceWriter class. This functionality is also encapsulated by ResXGen, so to view the schema, it is necessary only to run the following command:
ResXGen /schema