|
|
Trivial to change the color of pixels in a IconImage?
Does anyone know whether its a trivial matter to change the color of
some pixels of an IconImage? I know I can work with it through a
BufferedImage but how then do I go about changing the color. I suppose
it is not as simple as changing an entry of some palette.
Regards,
Casper
|
|
0
|
|
|
|
Reply
|
Casper
|
4/11/2006 1:42:05 PM |
|
Casper B. wrote:
> Does anyone know whether its a trivial matter to change the color of
> some pixels of an IconImage?
It depends on your definition of trivial.
> I know I can work with it through a
> BufferedImage but how then do I go about changing the color. I suppose
> it is not as simple as changing an entry of some palette.
Just a rough untested sketch, if you want to do it the old, slow way:
import java.awt.image.*;
class MyFilter extends RGBImageFilter {
public int filterRGB(int x, int y, int rgb) {
// do some change to rgb
return rgb;
}
}
ImageIcon ii = ...;
FilteredImageSource fis = new FilteredImageSource(
ii.getImage().getImageSource(),
new MyFilter());
Image changedImage = Toolkit.getDefaultToolkit().createImage(fis);
ii.setImage(changeImage);
//
// inform the users of the ImageIcon that they probably need to
// repaint themself
//
/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
|
|
0
|
|
|
|
Reply
|
Thomas
|
4/11/2006 2:23:34 PM
|
|
|
1 Replies
239 Views
(page loaded in 0.028 seconds)
Similiar Articles: Trivial to change the color of pixels in a IconImage? - comp.lang ...Does anyone know whether its a trivial matter to change the color of some pixels of an IconImage? I know I can work with it through a BufferedImage ... Find Color/Pixel in RGB BMP - comp.soft-sys.matlabTrivial to change the color of pixels in a IconImage? - comp.lang ..... whether its a trivial matter to change the color of some pixels ... rgb) { // do some change to ... Sketch Picture Transparency - comp.cad.solidworksTrivial to change the color of pixels in a IconImage? - comp.lang ... Just a rough untested sketch, if you want to do it the old, slow way ... It's fairly trivial exercise ... Pixel Calculation - comp.soft-sys.matlab... of a ball in an image to the edge of the image in pixels. ... noise first), and given the center cords, it's trivial ... Calculating change in a measure between visits - comp ... wglMakeCurrent is verry slow... - comp.graphics.api.opengl ...Trivial to change the color of pixels in a IconImage? - comp.lang ... wglMakeCurrent is verry slow... - comp.graphics.api.opengl ... Making the context current is not ... [comp.publish.cdrom] CD-Recordable FAQ, Part 1/4 - comp.publish ...Archive-name: cdrom/cd-recordable/part1 Posting-Frequency: monthly Last-modified: 2008/10/09 Version: 2.71 Send corrections and updates to And... Sampling: What Nyquist Didn't Say, and What to Do About It - comp ...The one thing that I would change is the line length. ... page height on a laptop LCD with 1400x1050 pixels) and ... popular crystal is 3579545Hz, as needed for NTSC color ... ATARI and Spectrum are rubbish - The C64 is the king of home ...The ATARI has only 3 ugly colors, ugly sprites and bad ... just 4 per line except for mode 10 with only 80 pixels ... mode 9 and 11 each have 16 colours), but can change ... Trivial to change the color of pixels in a IconImage? - comp.lang ...Does anyone know whether its a trivial matter to change the color of some pixels of an IconImage? I know I can work with it through a BufferedImage ... Icons - Microsoft Corporation: Software, Smartphones, Online ...... discussed in this article are subject to change ... are a varied lot—they come in many sizes and color ... BYTE bWidth; // Width, in pixels, of ... 7/24/2012 4:44:49 AM
|
|
|
|
|
|
|
|
|