0

デバイスの画面でhtmlからビットマップを作成するにはどうすればよいですか?

これを試しましたが、黒い画像出力が得られます

Webview mAppView = this.webView;
float appScale = mAppView.getScale();

int scaledViewHeight = (int)(webViewHeight * appScale);
int scaledViewWidth = (int)(webViewWidth * appScale);

bmp = Bitmap.createBitmap(scaledViewWidth, scaledViewHeight, Bitmap.Config.RGB_565);

try {
    os = new FileOutputStream(Environment.getExternalStorageDirectory()+"/DCIM/Camera/" + "canvas.png");
    bmp.compress(CompressFormat.PNG, 90, os);

    } catch(IOException e) {
        Log.v("save image", "fail"); 
    }
4

0 に答える 0