Results 1 to 4 of 4
Thread: Code for image to binary
- 12-22-2009, 12:59 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 6
- Rep Power
- 0
- 12-22-2009, 01:02 PM #2
Member
- Join Date
- Dec 2009
- Location
- Rio de Janeiro
- Posts
- 38
- Rep Power
- 0
This thread is duplicated.
Image to Binary bits
We usually help everybody. But it's not usual to give the complete code. JosAH sent to you the documentation needed to do what you want, please read it and you will be able to do it by yourself =)
Rgs.Last edited by renamed; 12-22-2009 at 01:13 PM.
Please don't laugh at my English... I'm trying my best! :)
- 12-22-2009, 01:05 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
- 12-24-2009, 04:48 PM #4
Member
- Join Date
- Sep 2009
- Posts
- 37
- Rep Power
- 0
I think you would have to create a PixelGrabber which returns an array of ints made from the image. Once you have that, I think you could use this method to convert the ints to binary:
Integer.toBinaryString(int);
Here is an example of a Pixel Grabber that creates a screen shot and throws it into an array of ints.
private int[] capture() throws InterruptedException {
dim = Toolkit.getDefaultToolkit().getScreenSize();
Image tmp = robot.createScreenCapture(new Rectangle(dim.width,dim.height)).getScaledInstance
(800,600,BufferedImage.SCALE_SMOOTH);
int pix[] = new int[IMG_WIDTH*IMG_HEIGHT];
PixelGrabber pg = new PixelGrabber
(tmp,0,0,IMG_WIDTH,IMG_HEIGHT,pix,0,IMG_WIDTH);
pg.grabPixels();
return pix;
}RAQ Report: free Java reporting tool.
Similar Threads
-
Image to Binary bits
By Deva in forum New To JavaReplies: 4Last Post: 12-24-2009, 04:49 PM -
How save Image BMP Binary type?
By shakall in forum SWT / JFaceReplies: 3Last Post: 12-22-2009, 01:50 PM -
code for binary tree in jsp
By ajay kumar in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 11-17-2009, 06:45 AM -
How to set the background of binary image?
By hyz_zsu in forum Java 2DReplies: 1Last Post: 04-09-2009, 03:14 AM -
converting image to binary code n vice versa
By nupurashi in forum Advanced JavaReplies: 4Last Post: 04-01-2009, 07:27 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks