簡體   English   中英

我的圖像上的畫布未隨圖像視圖一起縮放。

[英]My Canvas on the Image is not zooming along with the Image View.?

我在自定義圖像視圖上繪制了一個畫布,並對自定義圖像視圖應用了放大和縮小動畫。問題是我的畫布沒有隨圖像視圖一起縮放,我想將畫布與我的自定義圖像一起固定在android中使用自定義圖片視圖本身查看和縮放。如何實現?

如果回答,將不勝感激。

謝謝。

請嘗試例如在webview中的html中使用圖片...

String data = "<body>" + "<img src=\"resist1.png\"/></body>";
    WebView webView = (WebView) findViewById(R.id.resistorWebview);
    webView.loadDataWithBaseURL("file:///android_asset/", data,
            "text/html", "utf-8", null);

    // webView.loadUrl("file:///android_asset/image.html");
    WebSettings webSettings = webView.getSettings();
    webView.getSettings().setSupportZoom(true);

    webSettings.setJavaScriptEnabled(true);

    webSettings.setPluginsEnabled(true);
    webSettings.setAllowFileAccess(true);
    webSettings.setTextSize(WebSettings.TextSize.NORMAL);
    webSettings.setBuiltInZoomControls(true);
    webView.getSettings().setLoadWithOverviewMode(true);
    webView.getSettings().setUseWideViewPort(true);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM