PlanetJava
Custom Search

java-jmagick
[Top] [All Lists]

Changing pixel color problem

Subject: Changing pixel color problem
Date: Thu, 31 May 2007 07:54:13 -0700 (PDT)
Hi,
I want to change the color of a pixel using the following code:
----------------------------------------
            ImageInfo info = new ImageInfo("Dummy.jpg");
            MagickImage mi = new MagickImage(info);
            System.out.println("r="+mi.getOnePixel(5,5).getRed()+
                    " g="+mi.getOnePixel(5,5).getGreen()+
                    " b="+mi.getOnePixel(5,5).getBlue()); // r=32896 g=32896 
b=32896
            mi.getOnePixel(5,5).setRed(51200);  //the value of white: 255*256 = 
51200
            mi.getOnePixel(5,5).setGreen(51200);
            mi.getOnePixel(5,5).setBlue(51200);
            System.out.println("r="+mi.getOnePixel(5,5).getRed()+
                    " g="+mi.getOnePixel(5,5).getGreen()+
                    " b="+mi.getOnePixel(5,5).getBlue()); // r=32896 g=32896 
b=32896
----------------------------------------
but the values of red, green and blue stay the same. Anybody has any ideas? Is 
it a bug from the PixelPacket class?
Thanks alot,
Voicu
---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
_______________________________________________
JMagick mailing list
[email protected]
http://www.yeo.id.au/mailman/listinfo/jmagick
Please ensure that [email protected] is a recipient when replying.
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
  • Changing pixel color problem,
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy