Thursday, April 22, 2010

Re: [Java] Open a jpeg

 

I think you would do it like this:

BufferedImage bi = ImageIO.read(new File("pic.jpg"));
Raster raster = bi.getData();
DataBuffer dataBuffer = raster.getDataBuffer();
int size = dataBuffer.getSize();

int dataPic[] = new int[size];
for (int i = 0; i < size; i++)
{
     dataPic[i] = dataBuffer.getElem(i); 
}

umar faisol,

----- Original Message -----
From: Μακρής Γεώργιος <geom1971@yahoo.gr>
To: Java Official <Java_Official@yahoogroups.com>
Sent: Mon, 12 Apr 2010 04:27:59 +0700 (WIT)
Subject: [Java] Open a jpeg

 Hi ,

i need to write code to open a .jpg icon and to get all pixels of the pic in a array. I want to copy pixel from x1,y1 to x2,y2 .

can anyone help me please 

George 

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELY
.

__,_._,___

No comments:

Post a Comment