-
October 6th, 2003, 04:47 PM
#1
Creating an Image Icon With a .bmp Image
Does anyone know how to create an ImageIcon object with a bitmp image file. For instance, with a gif image, I can create an Image Icon thus
URL url = getClass().getResource("any.gif");
ImageIcon icon = new ImageIcon(url);
Now when I have a bitmap file called any.bmp I canot do the same as above. Why ??
Thanks
Melody
-
October 7th, 2003, 07:44 PM
#2
The ImageIcon class supports whatever the AWT Toolkit does. Which I think is only GIF, JPEG or PNG.
But here's something you might be interested in
http://www.esus.com/javaindex/j2se/j...p/javabmp.html
-
October 7th, 2003, 07:59 PM
#3
does your project prevents you from converting it into gif?
Vision.
-
October 7th, 2003, 09:36 PM
#4
Thanks Goodz and Ishabin. As for your question regarding whether or not I can am constrained not to convert to a GIF the answer is NO. If there is a way of converting to GIF without losing picture quality then please advise.
Many thanks
-
October 8th, 2003, 02:56 AM
#5
Recent versions of Microsoft Paint will allow you to do this conversion.
Live as if you were to die tomorrow. Learn as if you were to live forever.
-
October 8th, 2003, 03:37 AM
#6
Bitmap compulsion
Hey David is it necessary to convert the file into gif?? i mean is there any harm in continuing with a bitmap as i feel there are lot of code available that read a bitmap into a java program.
just give a thought
Thx
Devanand.Ch
-
October 8th, 2003, 06:32 AM
#7
You can...I'd just take the path of least resistance...(convert them to GIFs).
Live as if you were to die tomorrow. Learn as if you were to live forever.
-
October 8th, 2003, 07:12 AM
#8
yaa thatz also true but i was talking in terms of limitations set by client that he want a bitmap only etc.anyway ur thought is very well accepted
Thx
Devanand.Ch
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|