DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2006
    Posts
    4

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    BufferedImage img = ImageIO.read("myimage.gif") ;
    System.out.println("image width: "+img.getWidth()+" height:"+img.getHeight());

  3. #3
    Join Date
    Jun 2006
    Posts
    4
    Need import any class file?

    why "Undefined variable or class name: ImageIO" ?

  4. #4
    Join Date
    Jun 2006
    Posts
    4
    What means
    "Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable."

  5. #5
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    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.

  6. #6
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    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.

  7. #7
    Join Date
    Jun 2006
    Posts
    4
    oh...

    thanks anyway......

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2006, 03:16 PM
  2. Java and image processing
    By gayatri317 in forum Java
    Replies: 1
    Last Post: 01-26-2006, 03:15 AM
  3. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  4. Script for scrolling
    By Mark in forum Web
    Replies: 3
    Last Post: 08-30-2001, 11:45 AM
  5. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 04:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links