Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ImageReader

Posted on 2006-11-09
2
Medium Priority
?
292 Views
Last Modified: 2006-11-18
Hello...
I'm trying to read an image file. The format is in "pgm" files.
Because i try to make some code but it can't work. I surfed the internet and i found an article about ImageReader. I'm trying to put it in my code but it can't be compiled.
The error messages are : can't find symbol class ImageInputStream & Iterator
Can someone help me to fix this problem?
Or does someone can teach me how to read this type of files?

import java.io.*;
import java.net.*;
import java.awt.*;
import javax.imageio.*;
import javax.swing.*;

public class Source_Entropy {
      public void Source_Entropy() {
            
      }
      
      public static void main(String[] args) {
            File openFilePic;
            ImageInputStream buffInputPic;
            Iterator cekLoop = ImageIO.getImageReadersByFormatName("pgm");
            ImageReader readFile = (ImageReader)cekLoop.next();
            
            try {
                  openFilePic = new File("lena512.pgm");
                  buffInputPic = ImageIO.createImageInputStream(openFilePic);
                  
                  
            } catch(IOException e) {
                  e.printStackTrace();
      }
}
0
Comment
Question by:cemplukcute2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 9

Accepted Solution

by:
matthew016 earned 250 total points
ID: 17905480
import java.util.Iterator;
0
 
LVL 9

Expert Comment

by:matthew016
ID: 17905489
import javax.imageio.stream.*;
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question