embedded-resource

How to put an image on a JButton?

吃可爱长大的小学妹 提交于 2019-12-10 17:17:56
问题 I am writing a program that requires I have a button with an image over top of it, however, so far, I have not been able to get it to work. I have checked several other posts on this site, including How do I add an image to a JButton. My Code: public class Tester extends JFrame { public Tester() { JPanel panel = new JPanel(); getContentPane().add(panel); panel.setLayout(null); setTitle("Image Test"); setSize(300,300); setLocationRelativeTo(null); setDefaultCloseOperation(EXIT_ON_CLOSE);

directly embedded subreport in JasperReports

六月ゝ 毕业季﹏ 提交于 2019-12-10 14:48:16
问题 I am so close to having this work, I am trying to directly embed one jasper subreport into the main report xml of the other. You'd think this would be easy, but I can't find a single example on doing it. Everyone seems to use files or resources or whatever. I have one report working straight from a string and I want it to contain it's subreport. Anyone? Syntax? Thanks! 回答1: The only way I know of to do this with JasperReports is to use a separate .jrxml file for the subreport, and include it

Is it possible to embed and run exe file in a Delphi executable app?

眉间皱痕 提交于 2019-12-10 13:39:55
问题 Resource files (.RES) accept any kind of binary files but if it is an exe file how can I run it? 回答1: You would have to extract it as a file to disk and execute it. Although you don't have to extract it to disk, as Cosmin Prund says in a comment, if you don't it requires a lot of hard work. 回答2: http://sites.google.com/site/delphibasics/home/delphibasicssnippets/memoryexecutionunit-winxpwinvistawin7 Take a look at this memory execution unit.It allows you to execute an exe from memory without

Implicit localization, strongly typed resources, App_LocalResources and embedded resources

佐手、 提交于 2019-12-10 13:12:59
问题 tl;dr Does strongly typed resource code generation work with normal (non-embedded) resources in App_LocalResources ? If not then why, and does the alternative of using embedded resources in satellite assemblies work with implicit localization? The rest of this post just explains where I currently am in solving these questions, feel free to ignore it if you know the answers. When using implicit localization ( meta:resourceKey="Foo" syntax), I understand that one would need to write their own

Suppress “The resource name is not a valid identifier”

天涯浪子 提交于 2019-12-10 12:50:35
问题 I have a project with 5000+ resource strings in it. Almost all of them have periods in their identifier. We're switching over to automatically generating strongly-typed classes, and of course, because of the periods, we see a few thousand warnings The resource name 'blah' is not a valid identifier. I know it isn't, the generator changes periods to underscores, and everything is fine. Can I suppress the warning? It doesn't seem to have an associated number to #pragma away. 回答1: I think I can

Find all embedded resources in another assembly

白昼怎懂夜的黑 提交于 2019-12-10 12:33:29
问题 I'm working on localization for my project. For this, I have a class which should load an embedded resource from another assembly, and then read out the strings. But also I need to know which resource files this assembly contains. The number and which languages those are, is unknown. So how do I find out how the ".resx" file in this assembly is named? Those all have the same scheme: "de-DE.resx", "en-US.resx", and so on. I need to know how many of those files are contained in this assembly,

Java images not appearing in JAR file [duplicate]

隐身守侯 提交于 2019-12-10 12:18:35
问题 This question already has answers here : Java Swing: Displaying images from within a Jar (5 answers) Closed 6 years ago . Heres how i call the image Icon logoOne = new ImageIcon("logo.png"); // LOGO JLabel imageLogo = new JLabel(logoOne); imageLogo.setPreferredSize(new Dimension(200, 50)); Its just added to a panel in a JFrame and works fine when running in eclipse but doesnt show up when exported to JAR. can anyone help ? 回答1: When exporting your JAR file, you've to make sure you're also

Load images in jar file

岁酱吖の 提交于 2019-12-10 10:17:16
问题 I'm trying to load an image from an executable JAR file. I've followed the information from here, then the information from here. This is the function to retrieve the images: public static ImageIcon loadImage(String fileName, Object o) { BufferedImage buff = null; try { buff = ImageIO.read(o.getClass().getResource(fileName)); // Also tried getResourceAsStream } catch (IOException e) { e.printStackTrace(); return null; } if (buff == null) { System.out.println("Image Null"); return null; }

Displaying Icons stored as resources with alpha using GDIPlus (WIn32 C++)

柔情痞子 提交于 2019-12-10 10:06:46
问题 I have an icon with partial alpha (alpha values between 0 and 255) that I want to display using GDIPlus. When using the Bitmap constructor of GDI+ that takes the direct filename, the file displays properly. However, when loading from resource, it has a problem recognizing alpha. I looked on MSDN, and there are problems with alpha: http://msdn.microsoft.com/en-us/library/windows/desktop/ms536318.aspx. By retrieving the ICONINFO structure from the Icon, I can get rid of the fully transparent

Visual Studio 2008: How do I include project output as an embedded resource in another project?

浪子不回头ぞ 提交于 2019-12-10 03:49:54
问题 I have two projects in one Visual Studio 2008 solution. I'd like to use the primary output from one of the projects as an embedded resource in the other, but for the life of me I can't find any way to accomplish this. If I simply add the output file as a resource, then it doesn't seem to change when its source project is rebuilt. I even have the project dependencies/build order set up properly and this does not seem to help. Anyone have any hints for me? Thanks! 回答1: When you add an existing