Re: [問題] setPixel顏色出不來
: 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 都設定為一樣的值,當然出來是灰色或黑色啦...
我一開始還以為你的程式碼是要轉灰階 @@
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.238.134.227
※ 文章網址: https://www.ptt.cc/bbs/java/M.1450510353.A.330.html
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
java 近期熱門文章
PTT數位生活區 即時熱門文章