Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-25-2008, 12:27 AM
Member
 
Join Date: May 2008
Posts: 1
the_transltr is on a distinguished road
Scanning Image Pixel by Pixel
I just want to know some idea on how to scan every pixel from an image file and put it into an array.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-26-2008, 07:26 AM
roots's Avatar
Moderator
 
Join Date: Jan 2008
Location: Dallas
Posts: 286
roots is on a distinguished road
BufferedImage (Java 2 Platform SE 5.0)

look for getRGB
__________________
dont worry newbie, we got you covered.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-27-2008, 12:27 PM
M77's Avatar
M77 M77 is offline
Member
 
Join Date: May 2008
Location: LV
Posts: 36
M77 is on a distinguished road
Send a message via Skype™ to M77
import java.awt.image.*;
import java.awt.*;
import java.applet.*;

public class Sprite {
private String name;

public int[] b;
public int w;
public int h;

public Sprite(Applet a, String filename, int width, int height) {
try {
name=filename.substring(0, filename.indexOf('.'));
w=width;
h=height;
Image img=a.getImage(a.getDocumentBase(), filename);
b=new int[h*w];
PixelGrabber pg= new PixelGrabber(img, 0, 0, w, h, b, 0, w);
pg.grabPixels();
if (pg.status()==192) {
throw new RuntimeException("error loading "+filename +" sprite");
}
//now b[0] is the leftest pixel of the top
// b[w-1] is the rightest pixel of the top
} catch(Exception e) {
e.printStackTrace();
}
}
}
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-28-2008, 11:45 PM
Member
 
Join Date: May 2008
Posts: 21
gogoc is on a distinguished road
depends upon the format of the image
bitmap stores 3 variables for each pixel
and there must be some api for doing image processing
google for that
__________________
get new coding problems at
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
image removing Triss New To Java 3 01-20-2008 10:27 PM
Converting multiple banded image into single banded image... Image enhancement archanajathan Advanced Java 0 01-08-2008 07:29 PM
how to set an image size valery New To Java 1 08-06-2007 10:27 PM
How can I get a transparent pixel from an image samson Java 2D 1 07-17-2007 06:10 AM
Image Verification peiceonly Java Servlet 1 04-27-2007 06:50 PM


All times are GMT +3. The time now is 12:19 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org