embedded-resource

How to embed multilanguage *.resx (or *.resources) files in single EXE?

我的未来我决定 提交于 2019-11-28 20:36:37
There are plenty of tutorials how to create multilanguage RESX files and how to create satellite assemblies with AL.exe, but I haven't found working example how to embed RESX/Resources/satellite-DLL files in single EXE file and distribute whole multilanguage app as such EXE. I tried to use ilmerge.exe, but it looks like it doesn't work for multiple DLLs with the same name (culture satellite DLLs have identical names, originally residing in different subdirs named after culture). I also don't know how to create ResourceManager instance to work with embedded resources. My goals is to enable

Creating a “.rc” file in Visual Studio 2010 Express

こ雲淡風輕ζ 提交于 2019-11-28 12:38:01
I'm trying to learn game programming. I am using Microsoft Visual Studio 2010 Express on Windows Vista. I want to know how to create a resource file (.rc). The microsoft website gives some fairly ambiguous instructions on creating one. http://msdn.microsoft.com/en-us/library/sxdy04be.aspx . If I go to my Solution explorer , right click and select Add New Item , the IDE does not give a .rc file as one of the options. It only gives me a .cpp, .h and windows form as options. I don't know what to do. I just can't figure out where i'm goofing up. I'd be very grateful if someone could point me in

Java Swing ImageIcon, where to put images?

房东的猫 提交于 2019-11-28 12:19:57
I'm following this tutorial for java swing games: http://zetcode.com/tutorials/javagamestutorial/movingsprites/ At this point: ImageIcon ii = new ImageIcon(this.getClass().getResource()); image = ii.getImage(); I just don't know what kind of path I have to write and where should I save my images (which directory). Would you help me please? Would you give an example? Steven In your src folder, create a folder called "images" or "files" then put the image in there. Then use this: ImageIcon(this.getClass().getResource("/images/filename.png")); If that doesn't work, try this: ImageIcon(this

How can I force Proguard to keep my .xml resource file?

浪尽此生 提交于 2019-11-28 12:04:10
I am succesfully using proguard for my Android apps. However, with one app I am having trouble. This app uses a java library that has a .xml file that is stored in the package. InputStream istream = Library.class.getResourceAsStream("resource.xml"); This library works great when proguard is disabled. However, running proguard, it seems that the xml file is just completely stripped away. Relevant proguard.cfg -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify #-dontobfuscate #-repackageclasses '' //THIS IS DISABLED -keepattributes *Annotation*

How can we add embedded resources to a file which is compiled from a source file at run-time

萝らか妹 提交于 2019-11-28 10:30:35
I'm writing a small application which works at compiling a file from a source (.cs) code file using a function: public static bool CompileExecutable(String sourceName) { //Source file that you are compliling FileInfo sourceFile = new FileInfo(sourceName); //Create a C# code provider CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp"); //Create a bool variable for to to use after the complie proccess to see if there are any erros bool compileOk = false; //Make a name for the exe String exeName = String.Format(@"{0}\{1}.exe", System.Environment.CurrentDirectory, sourceFile.Name

resource file in PyQt4

痞子三分冷 提交于 2019-11-28 10:11:33
I'm trying to understand an example in PyQt4 (simpletreemodel.pyw) I see the code import simpletreemodel_rc But I can't see where the module is used in the example code When I examine the module simpletreemodel, I see: from PyQt4 import QtCore qt_resource_data = b"\ \x00\x00\x07\xb9\ \x47\ \x65\x74\x74\x69\x6e\x67\x20\x53\x74\x61\x72\x74\x65\x64\x09\x09\ \x09\x09\x48\x6f\x77\x20\x74\x6f\x20\x66\x61\x6d\x69\x6c\x69\x61\ \x72\x69\x7a\x65\x20\x79\x6f\x75\x72\x73\x65\x6c\x66\x20\x77\x69\ \x74\x68\x20\x51\x74\x20\x44\x65\x73\x69\x67\x6e\x65\x72\x0a\x20\ \x20\x20\x20\x4c\x61\x75\x6e\x63\x68\x69\x6e

Audio file plays in Eclipse IDE; but NOT as JAR file

依然范特西╮ 提交于 2019-11-28 09:54:48
问题 The audio file that I am using is found here: http://www.orangefreesounds.com/loud-alarm-clock-sound/ This is what my file structure looks like in my Eclipse IDE: The audio file plays perfectly fine when I run it in my IDE, but not when I export it as a JAR file. I have already checked and found that the audio file is inside the JAR file. I am using the terminal command java -jar Sandbox.jar & to run the JAR file. The program seems to be able to find the file (since it is not throwing an

how to access resources(Excel file) in jar file

谁都会走 提交于 2019-11-28 08:18:14
问题 Hi i have exported my java project as executable jar file. inside my project I am accessing a Excel file containing some data. Now I am not able to access the Excel file when I am trying to access the file. My project structure is: Java_Project_Folder - src_Folder - resources_Folder(Containing excel file) I am accessing the excel file like FileInputStream file=new FileInputStream(new File(System.getProperty("user.dir") +File.separator+"resources"+File.separator+"Excel.xlsx")); I have tried

Extracting zipped file from ResourceStream throws error “Invalid stored block lengths”

≡放荡痞女 提交于 2019-11-28 07:30:31
问题 I am trying to extract a ZIP file from my current JAR using: InputStream resource = getClass().getClassLoader().getResourceAsStream(name); This get the correct InputStream , but it gives an error when I try to unzip it using the following code (I'm storing each file into a Hashmap<file, filename> ): public static HashMap<String, String> readZip(InputStream inputStream) throws IOException { byte[] buffer = new byte[1024]; HashMap<String, String> list = new HashMap<>(); ZipInputStream

Load image from a filepath via BufferedImage

对着背影说爱祢 提交于 2019-11-28 07:14:46
问题 I have a problem with Java application, particular in loading a image from a location in my computer. Following this post I used a BufferedImage and a InputFileStream to load an image on my computer. First, I put the image ( pic2.jpg ) into the source code and that is working. However, if I put the image to another place (let's say C:\\ImageTest\pic2.jpg ), Java IDE show me an IllegalArgumentException return ImageIO.read(in); here is the code: public class MiddlePanel extends JPanel { private