Article View: borland.public.jbuilder.java.language
Article #15290Re: setPixels(...) ?
From: Christophe
Date: Wed, 23 Jun 1999 00:00
Date: Wed, 23 Jun 1999 00:00
29 lines
1760 bytes
1760 bytes
Hi Claude
Still on the PixelGrabber, I see.
With it, you are working with an integer Array where you store the int
value of the color used by the Pixel, and setPixels deals with the array and
not the Image from where you grabbed the pixels.
If you use double-buffering technique, you can use drawLine with the
location of your pixels for the start and the end of the line. This method
is from Graphics. But this not the best way ;-)
So, I've found another way to work with the color of the Pixel. I haven't
test it yet. You can use a Buffered Image, descendant of Image. This class
provides access to the color of pixels with getRGB(x,y). Create it with
using typecasting with the createImage method:
buffImg=(BufferedImage)createImage(width,height);
Be careful with the graphics return by BufferedImage.getGraphics(), this
class return a Graphics2D, so I don't know if Buffered Image works for non
Java2 applications.
Complete example in the chapter 5 of 'Programmer's Guide to the JavaTM 2D
API' from JDK 1.2 doc.
Tell us if you try and could you answer to my last message about the
floodFill algorithm ?
Thanks and hope this help.
Technical Details
Message-ID:
<7kqcaa$9i213@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37700EC5.D280B53E@smile.ch>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,f36401a47394ea82 X-Google-Attributes: gidf74b3,public From: "Christophe" <cespern@ragemail.com> Subject: Re: setPixels(...) ? Date: 1999/06/23 Message-ID: <7kqcaa$9i213@forums.borland.com> X-Deja-AN: 492881861 Content-Transfer-Encoding: 7bit References: <37700EC5.D280B53E@smile.ch> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language