Re: [問題] 動態縮放圖片大小時遇到Excpetion
自推一下!解決了這個問題。
會出現IllegalArgumentException:x + width must be <= bitmap.height()的原因在於
我宣告了兩個int型態的變數bmpWidth,bmpHight來擷取圖檔的寬跟高(如Line3,4)
接著我用Matrix來做縮放的比率(如Line7,8)
最後重點在Line9, 15, 21
透過Bitmap.createBitmap的方法將圖檔大小重新縮放的時候
bmpWidth跟bmpHeight的值就一直被縮小縮小,導至Line21要重新縮放時
系統判定bmpWidth跟bmpHeight的值已經為0而產生Exception。
若解釋的不清楚,再麻煩高手補充一下^^"
感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.117.230.159
討論串 (同標題文章)