i have drawn an image in canvas,now i want to make it as an image so that i be able to extract the pixel information from it,how can i make an Image object from the information in canvas
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words (single letters are not permited), separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements. Thanks.
Manu, The way I would do it is use the createImage( x, y ) method in Component to create a "back buffer" image ( normally used in double buffering ) that you do all the drawing to in your paint method. Then, at the end of the paint method, you simply do a g.drawImage( buffer, 0, 0, this ) to draw to the screen. You would also have a reference to the image being shown on the screen.
HTH, -Nate [This message has been edited by Nathan Pruett (edited April 12, 2001).]
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.