Re: [问题] setPixel颜色出不来

楼主: darkk6 (Mr. Pan)   2015-12-19 15:32:30
: for(int x=0;x<picture.getWidth();x++) {
: for (int y = 0; y < picture.getHeight(); y++) {
: picture2.setPixel(x,y,Color.argb(Color.alpha(0),
: Color.red(picture.getPixel(x, y)),
↑↑
: Color.red(picture.getPixel(x, y)),
↑↑
: Color.red(picture.getPixel(x, y))));}}
↑↑
: ...
: 出来的结果应该有颜色的地方却都变成黑色(形状还在)
Color.argb( Alpha , Red , Green , Blue );
你的 Red , Green , Blue 都设定为一样的值,当然出来是灰色或黑色啦...
我一开始还以为你的程式码是要转灰阶 @@

Links booklink

Contact Us: admin [ a t ] ucptt.com