Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2005

Tip: Looking for answers? Try searching our database.

drawImage returns false for Microsoft Java

Thread view: 
igorkhalatian@hotmail.com - 26 Jul 2005 00:00 GMT
barray - contains byte[] array of the PNG image

image = Toolkit.getDefaultToolkit().createImage(barray);

MediaTracker t = new MediaTracker(this);
t.addImage(image, 0);
try {
 t.waitForAll();
}
catch (InterruptedException e) {
 Thread.currentThread().interrupt();
}
...
ret = g.drawImage(image, x,y, this);

THIS WORKS FINE IN JUN JAVA but in Microsoft JVM drawImage always
returns false.
Any help is greatly appreciated.
Thomas Fritsch - 26 Jul 2005 01:30 GMT
> barray - contains byte[] array of the PNG image
>
[quoted text clipped - 14 lines]
> returns false.
> Any help is greatly appreciated.

It is probably because Microsoft's JVM doesn't support PNG images.
If I remember it correctly, the MS-JVM is java-version 1.1. And back in
those days Java (both Sun and MS) only supported JPEG and GIF images.

Signature

"TFritsch$t-online:de".replace(':','.').replace('$','@')

igorkhalatian@hotmail.com - 26 Jul 2005 03:28 GMT
Thank you for replying.
You are correct. It is JAVA 1.1 but documentation is very vague on this
one something like "supported format such as GIF or JPEG" so I was
wondering if PNG was there. Do you actually know if there is a list of
supported formats for 1.1 to put this issue to rest?

And more importantly if I have bytes containing PNG image and a have to
get them displayed under java 1.1 what are my options?

> > barray - contains byte[] array of the PNG image
> >
[quoted text clipped - 18 lines]
> If I remember it correctly, the MS-JVM is java-version 1.1. And back in
> those days Java (both Sun and MS) only supported JPEG and GIF images.
Andrew Thompson - 26 Jul 2005 06:49 GMT
> And more importantly if I have bytes containing PNG image and a have to
> get them displayed under java 1.1 what are my options?

showDoc( pathToImage );
?

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
You Can't Prove It Won't Happen

Thomas Fritsch - 26 Jul 2005 11:56 GMT
igorkhalatian@hotmail.com write:

> Thank you for replying.
> You are correct. It is JAVA 1.1 but documentation is very vague on this
[quoted text clipped - 4 lines]
> And more importantly if I have bytes containing PNG image and a have to
> get them displayed under java 1.1 what are my options?

Read the javadoc of class java.net.ContentHandler, how you can extend
the set of supported image formats. It involves developing a
ContentHandler for the MIME-type "image/png".
To get the built-in set of supported image formats, look into the main
zip/jar file(s) of your Java runtime and see what class files are in
package "sun.net.www.content.image". In Java 1.4 I find:
    gif, jpeg, png, x_bitmap, x_pixmap.
In Java 1.1 there are probably less than those.

Signature

"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')

igorkhalatian@hotmail.com - 27 Jul 2005 04:48 GMT
Thank you, I will take a look.
Andrey Kuznetsov - 26 Jul 2005 13:28 GMT
> And more importantly if I have bytes containing PNG image and a have to
> get them displayed under java 1.1 what are my options?

http://reader.imagero.com

works with java 1.1, supports many formats, free for non commercial use.

Signature

Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

igorkhalatian@hotmail.com - 27 Jul 2005 23:17 GMT
Andrey,

For me it's an overkill (size,functionality,price).
All I need is a reliable PNG decoder preferably with source code.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.