embedded-resource

SDL draw PNG image from raw image data string

扶醉桌前 提交于 2019-12-11 17:46:07
问题 I've setup a PNG resource file in my SDL2 project for Windows 32bit in C++. HRSRC hRes = FindResource(0, MAKEINTRESOURCE(IMGID), "PNG"); if (!hRes) { Log::Error("Find resource IMGID"); return; } HGLOBAL hData = LoadResource(0, hRes); if (!hData) { Log::Error("Load resource IMGID"); return; } DWORD dataSize = SizeofResource(0, hRes); char* data = (char*)LockResource(hData); std::string result; result.assign(data, dataSize); The result variable contains all the characters of the PNG image (if

MissingManifestResourceException for EmbeddedResouce in Silverlight

▼魔方 西西 提交于 2019-12-11 12:09:19
问题 I write Silverlight games using XNA-based Silverlight engines. I have a previous game where I have files (MP3s and text files) with Build Action set to Embedded Resource , and no *.resx file to be seen in my solution. The game runs fine; you can see the production version here. On the other hand, my current project doesn't allow this. When I try to make files Embedded Resource s, I get a MissingManifestResourceException thrown in my constructor of the main UserControl instance that starts my

When searching Youtube using the Data API, how can I exclude videos that cannot be played externally?

青春壹個敷衍的年華 提交于 2019-12-11 11:57:18
问题 The Youtube API will return videos that can be played no problem within the chromeless player. It also returns videos that cannot be played, - "Embedding disabled by request". I don't want to retrieve videos that cannot be played, is there a way to request only videos that can be embedded? cheers 回答1: Yes, there is a parameter exactly for this purpose. In this Url http://gdata.youtube.com/feeds/api/videos?q=connemara&orderby=published&max-results=10&v=2&format=5 the "format=5" parameter

Java unknown source with ImageIO

流过昼夜 提交于 2019-12-11 09:36:01
问题 My program runs fine in Netbeans, but I get the following error when I run my applet in a browser: java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(Unknown Source) I opened the jar to verify that the png files are correctly placed there. I'm not certain why the following doesn't work (in a try block, of course): BufferedImage beam = ImageIO.read(this.getClass().getResource("images/beam.png")); I've tried other things like the following, but suspect the problem

How Do I Get Folder Names From C# Embedded Resource

心不动则不痛 提交于 2019-12-11 09:33:33
问题 I want to order resources the way a filesystem would order them. I can't do a string.split on the name, because the folders are seperated by '.' characters, not '\' characters. This means that having any periods in folder or file names would break the sort. Is there any way to change the seperator character, or get a different breakdown for the original location of an embedded resource? 回答1: This will get you a string array of all the resources. System.Reflection.Assembly.GetExecutingAssembly

How can I read embedded .resx in different assembly

倖福魔咒の 提交于 2019-12-11 09:16:50
问题 I have some dlls in my project that only contain many .resx files as embedded resources. In each project the .resx files are put into different folders. The property "Custom Tool Name Space" of all is set to the namespace of each project. When I try to use ResourceManager to get a string I get an error that for example "MyTemplate.resources" is not found but I only have "MyTemplate.resx" in the dll. How can I access my resources? new ResourceManager(typeof(MyTemplate.resx)).GetString(

Determine which STRINGTABLE is included in EXE

孤街浪徒 提交于 2019-12-11 07:35:19
问题 My Delphi application uses the Microsoft Resource Compiler (rc.exe) to compile a list of strings (text format in a .rc file) like this: Language LANG_KOREAN, SUBLANG_KOREAN STRINGTABLE BEGIN cszLanguageName "Korean" <etc> END into a .res file. All tables contains the same IDs (such as cszLanguageName ). I maintain two separate resource string files. One contains mostly European languages (English, Czech, etc) which I call "Standard.rc". The other is called "Alternate.rc" and contains all

Trouble getting contents of resource text file into StreamReader

主宰稳场 提交于 2019-12-11 07:31:52
问题 I'd like to have a GUI that gives the user two options: Read in a key file loaded by the user through openFileDialog. Read in a preloaded key file (user would select one using radioButtons). This would be helpful in that the user would not need to carry around all our key files, but it would still allow flexibility if a new key file needed to be added. My code is currently working for option #1. I use: readFile = new StreamReader(KeyFileFullPath); where KeyFileFullPath is the filepath to the

SetIconImage from Images in the resource

泄露秘密 提交于 2019-12-11 05:39:30
问题 I have A swing Application that has an Image Folder in the resources. I use the Following Piece of code to access the Images: btnDel = new JButton(new ImageIcon(getClass().getResource("/Recycling-Pool.png"))); This Methods Works fine For me in reference to Images for Components such as JLabels and JMenuItems. I have an Icon for the Application which I access using the Following Code: setIconImage(getToolkit().getImage("Images/Free bsd.gif")); This Also works fine for the Bar Icon, But I want

Embedding an external executable inside a C# program and run it without creating new file [duplicate]

三世轮回 提交于 2019-12-11 04:45:34
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do I invoke an exe that is an embedded resource in a .Net assembly? How do I embed an external executable inside my C# ( I suppose via Resources, but I don't know about other ways, so this option is needed in this question - too ) and run this program inside main running program without writing it to the disk. How could it be done? 回答1: Despite Hans' comment I think it is pretty easy* (assuming code have