-
Help - Java Image
I am new to java 
Can I know how to get image width and height in java?
got any simple example to refer?
thanks
-
BufferedImage img = ImageIO.read("myimage.gif") ;
System.out.println("image width: "+img.getWidth()+" height:"+img.getHeight());
-
Need import any class file?
why "Undefined variable or class name: ImageIO" ?
-
What means
"Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable."
-
of course you need to import the classes BufferedImage and ImageIO.
since my eclipse does such automatically, i can't tell you where to find them.
just go to the javadoc and browse to that classes and include their full package+class names in the import.
-
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
hmm, are you starting the code from a unix-shell?
if so, you will not be able to work on images, since java needs a display-driver as used on graphical environments to work with images.
as far as i know there are some "fake" drivers that java can use to create a virtual display console to work with images. but you will have to google to solve that.
-
oh...
thanks anyway......
Similar Threads
-
Replies: 2
Last Post: 06-14-2006, 03:16 PM
-
By gayatri317 in forum Java
Replies: 1
Last Post: 01-26-2006, 03:15 AM
-
Replies: 1
Last Post: 05-13-2005, 06:46 AM
-
Replies: 3
Last Post: 08-30-2001, 11:45 AM
-
By JJ in forum Enterprise
Replies: 1
Last Post: 07-06-2000, 04:50 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks