0
我正在從gallery中搜索圖像,然後顯示出來。現在我想要在onDraw(Canvas canvas)
中顯示圖像。我該怎麼做。請親切地幫助我。 在此先感謝如何將uri圖像轉換成canvas抽取方法
selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
Toast.makeText(getBaseContext(),"selected"+selectedImagePath,Toast.LENGTH_LONG).show();
System.out.println("Image Path : " + selectedImagePath);
img.setImageURI(selectedImageUri);
這裏uri selectedImageUri;
我OnDraw(canvas Canvas)
代碼:
Bitmap myBitmap1 = BitmapFactory.decodeResource(getResources(),selectedImageUri);
我的錯誤消息
在類型BitmapFactory方法decodeResource(資源,INT)是不適用的參數(資源URI)