embedded-resource

Problems with images when compiled

谁说我不能喝 提交于 2019-12-18 09:26:47
问题 I have been all over the internet trying to work out how to get an image icon displayed after compiling into a runnable jar. I discovered this problem way too late, I ran my program many times before in eclipse and every thing has worked, now 6 months later with project finished, I compiled my program with eclipse and no audio or images work. Reading on the net, it says about the location of images folder should be inside jar, but mine doesnt get put there? I have played around with the

Loading Icon resource error

青春壹個敷衍的年華 提交于 2019-12-18 09:07:21
问题 In Eclipse, when I run the code, this works: import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; public class Main { public static void main(String[] args) { JFrame frame = new JFrame("test viewing images"); frame.setSize(600,300); frame.setLocationRelativeTo(null); // centered on monitor frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); /** * Menu Bar stuff */ JMenuBar menuBar; JMenu menu; JMenuItem

Embedded Database in Qt

…衆ロ難τιáo~ 提交于 2019-12-18 07:52:47
问题 I have a SQLite database for my Qt application. I assume that it would be logical to add the database as a resource. I can't get my app to compile with the embedded resource. connection.h #ifndef CONNECTION_H #define CONNECTION_H #include <QMessageBox> #include <QSqlDatabase> #include <QSqlError> #include <QSqlQuery> static bool createConnection() { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(":/data/ShippingData.db3"); if (!db.open()) { QMessageBox::critical(0,

ImageIcons on JButton are not showing up in Runnable JAR file

試著忘記壹切 提交于 2019-12-18 06:48:24
问题 I have 6 JButtons on my GUI all have images on it, when I compile and run the code, all images on JButtons show up perfectly but in runnable JAR file, images on JButtons are not showing up.. how do I fix this problem? I used this method in my code to show icons on JButtons ImageIcon SettingsIc = new ImageIcon("bin/images/settings.png"); jb1 = new JButton(SettingsIc); jb1.setFocusPainted( false ); //jb1.setBorderPainted(false); jb1.setContentAreaFilled(false); This is how my GUI looks when I

MS WebBrowser + Embedded HTML Resource + res:// Protocol

时间秒杀一切 提交于 2019-12-18 04:48:07
问题 I have an embedded HTML resource (helloworld.htm) inside my Visual Studio project. (Ie, I've added an HTML file to the project and set its properties to "Embedded Resource". Within the same application I have a WebBrowser control. I'd like to direct the WebBrowser control to display the HTML resource using the res:// protocol. But I can't figure out the exact format needed to address an embedded resource using this style of URL. Any ideas? Thanks! 回答1: I know this thread is dead, but I had to

Embedding a font in delphi

↘锁芯ラ 提交于 2019-12-18 03:12:40
问题 I'm working on an app that requires a particular barcode true type font that is unlikely to be on the user's PC. Can I somehow embed the font in the app, or do I need to use the installer to install the font? 回答1: Yes, you can save it as a resource in the EXE file, and on user's pc, you can extract it as a file using a TResourceStream instance. Then you can call AddFontResource API function. At last, you should send a WM_FONTCHANGE message to all top-level windows in the system (Check Remark

How do I reference a resource in Java?

浪子不回头ぞ 提交于 2019-12-17 23:48:04
问题 I need to read a file in my code. It physically resides here: C:\eclipseWorkspace\ProjectA\src\com\company\somePackage\MyFile.txt I've put it in a source package so that when I create a runnable jar file (Export->Runnable JAR file) it gets included in the jar. Originally I had it in the project root (and also tried a normal sub folder), but the export wasn't including it in the jar. If in my code I do: File myFile = new File("com\\company\\somePackage\\MyFile.txt"); the jar file correctly

How do I reference a resource in Java?

£可爱£侵袭症+ 提交于 2019-12-17 23:47:15
问题 I need to read a file in my code. It physically resides here: C:\eclipseWorkspace\ProjectA\src\com\company\somePackage\MyFile.txt I've put it in a source package so that when I create a runnable jar file (Export->Runnable JAR file) it gets included in the jar. Originally I had it in the project root (and also tried a normal sub folder), but the export wasn't including it in the jar. If in my code I do: File myFile = new File("com\\company\\somePackage\\MyFile.txt"); the jar file correctly

Howto embed images in Actionscript 3 / Flex 3 the right way?

时光总嘲笑我的痴心妄想 提交于 2019-12-17 18:37:48
问题 I'm creating a game where a lot of images are being used in Actionscript / Flex 3 (Flash). Now that I've reached the designer stage, I have to work out a structural way of using embedded images (which have to be manipulated with rotation, color, etc.). Unfortunately, after investigating a bit, it looks like you have to manually embed images before you can use them. I currently have it setup like this: Resource.as class file: package { public final class Resource { [Embed (source="/assets

What's the difference between a Resource and an Embedded Resource in a C# application?

我怕爱的太早我们不能终老 提交于 2019-12-17 17:42:06
问题 When should I use one or the other? I'd like all of the files I use in my app (images, sound, xml file, etc.) to be inside of the .exe file so I don't deploy with a bunch of folders and files. Thanks for the info. 回答1: “Resource” and “Content” build actions are to access the WPF resources using the Uris. However “Embedded Resource” is for prior technologies. However both options embed the resource in assembly but “Resource” option to be used for WPF. MSDN provides full explanation here. 回答2: