Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Count pixels

Reply
Thread Tools

Count pixels

 
 
TheC0der
Guest
Posts: n/a
 
      08-23-2006
Hello everybody!
I need to know how many white(or other colors) pixels are in Graphics,
but i didnt found way . I see that there is solution for Image, but
this cant help me.
I have one more question - (may be is silly) How to copy Image to
Graphics and Graphics to Image?
Thanks for your attention.

 
Reply With Quote
 
 
 
 
Ingo R. Homann
Guest
Posts: n/a
 
      08-23-2006
Hi,

TheC0der wrote:
> Hello everybody!
> I need to know how many white(or other colors) pixels are in Graphics,
> but i didnt found way . I see that there is solution for Image, but
> this cant help me.
> I have one more question - (may be is silly) How to copy Image to
> Graphics


g.drawImage();

> and Graphics to Image?


AFAIK impossible. The solution is to create an Image, to get its
Graphics and to paint on this graphics.

Hth,
Ingo

 
Reply With Quote
 
 
 
 
Josh Falter
Guest
Posts: n/a
 
      08-24-2006
Disclaimer: There may be a slick way to do the counting of white
pixels, but off the top of my head I know that java.awt.Robot has a
getPixelColor(x,y) function that you could use if you got desperate.

 
Reply With Quote
 
Oliver Wong
Guest
Posts: n/a
 
      08-24-2006

"TheC0der" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> Hello everybody!
> I need to know how many white(or other colors) pixels are in Graphics,
> but i didnt found way . I see that there is solution for Image, but
> this cant help me.
> I have one more question - (may be is silly) How to copy Image to
> Graphics and Graphics to Image?


Think of the Graphics object as a pen, and the Image object as a sheet
of paper. You use the Graphics object to draw on the Image, just like you
use a pen to draw on a paper. However, the Graphic object itself does not
store the picture your drew, just like the pen doesn't store the picture.
The picture is stored on the paper, or the Image object.

- Oliver

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why don't Sony and Pentax have this problem? Dead pixels, defective pixels RichA Digital Photography 9 04-12-2011 08:54 AM
Can hot pixels become dead pixels? kl_tom Digital Photography 4 10-05-2006 06:52 PM
Count(*) in a Subquery with multiple tables: How does SQL determine which table to generate the Count() from? Kaimuri MCSD 3 12-29-2004 06:38 PM
Pse explain "3.1m effective pixels and 6.0m redorded pixels" notreallyme Digital Photography 14 12-28-2003 03:41 PM
What's the difference between effective pixels and recorded pixels? Mark Grady Digital Photography 10 09-28-2003 11:11 PM



Advertisments