users
[Top] [All Lists]

Re: [cinjug-users] Java application artwork

To: users@xxxxxxxxxx
Subject: Re: [cinjug-users] Java application artwork
From: Ed Kolis <ekolis@xxxxxxxxxxxx>
Date: Fri, 20 Jul 2007 11:44:34 -0400
Delivered-to: mailing list users@xxxxxxxxxx
In-reply-to: <7C9F02162E38D14592ABC31EB62FFDF17DC4F8@xxxxxxxxxxxxxxxxxxxxx>
Mailing-list: contact users-help@xxxxxxxxxx; run by ezmlm
References: <7C9F02162E38D14592ABC31EB62FFDF17DC4F8@xxxxxxxxxxxxxxxxxxxxx>
User-agent: Thunderbird 1.5.0.12 (X11/20070604)
Java applications can use *.png files as icons, and if the png file has transparency, then the transparent areas will indeed be transparent. Here's a simple scenario of using a png file as an icon - it would probably be better for the developer to load the icon as a resource rather than from a file, but he should get the point:

// Create a new window and set its icon to a png file and display it
JFrame frame = new JFrame();
try {
   Image logo = ImageIO.read(new File("logo.png"));
   frame.setIconImage(logo);
} catch (IOException ex) {
   // do whatever you need to do if the file is not found
}
frame.setVisible(true);

Note that if the png file is the wrong size, it will be scaled automatically - how convenient!


Scott Hofmann wrote:

Hello All,
I'm working with a Java developer on a project and he has asked for our logo to insert into the application. The logo is intended for the upper left hand corner of the application window bar. I provided an .ico file so the background area of the round logo would be masked but the white background keeps showing up in the application with a white background.

I can't just match the color of the bar the logo sits in since a person can change their system theme which then changes the color of the bar the logo presently resides in. Would someone direct me as to what file type or procedure either I as the graphic's person or he as the developer needs to do to get the logo to show up with a transparent background in the application.

- Scott Hofmann



<Prev in Thread] Current Thread [Next in Thread>