[問題] setPixel顏色出不來

看板java作者 (哀鳳最終款)時間9年前 (2015/12/18 17:14), 編輯推噓0(003)
留言3則, 3人參與, 最新討論串1/2 (看更多)
各位先進們晚安 我有一張圖叫做picture 我要複製出來變成picture2 Bitmap picture; Bitmap picture2; ... 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))));}} ... 出來的結果應該有顏色的地方卻都變成黑色(形狀還在) 請問有人可以提醒我漏掉什麼地方嗎? 謝謝了! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.136.95.238 ※ 文章網址: https://www.ptt.cc/bbs/java/M.1450430085.A.415.html

12/18 18:07, , 1F
Color.alpha(0) 是什麼意思啊?
12/18 18:07, 1F

12/18 22:44, , 2F
alpha 0 = 透明的吧,沒有要改透明度用 Color.rgb就好
12/18 22:44, 2F

12/21 09:59, , 3F
解決了,謝謝樓上大大
12/21 09:59, 3F
文章代碼(AID): #1MSyw5GL (java)
討論串 (同標題文章)
文章代碼(AID): #1MSyw5GL (java)