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