Android: transparent webcam view above the camera

Just a general question, and maybe someone has an idea: is it possible to have a transparent WebView over Camera SurfaceView and use HTML / CSS to create an overlay?

+4
source share
3 answers
<!-- in XML --> <WebView android:id="@+id/webkit" android:layout_width="200dip" android:layout_height="wrap_content" android:maxWidth="200dip" android:maxHeight="200dip" android:layout_marginBottom="4dip" android:adjustViewBounds="true" android:visibility="gone" /> // onCreate barcodeBrowser = (WebView)findViewById(R.id.webkit); ... // somewhere in runtime barcodeBrowser.setVisibility(View.VISIBLE); String downloadLink = "http://stackoverflow.com/questions/1260422/setting-webview-background-image-to-a-resource-graphic-in-android"; barcodeBrowser.setBackgroundColor(Color.argb(0,0,0,0)); barcodeBrowser.setBackgroundResource(R.drawable.icon); barcodeBrowser.loadUrl(downloadLink); 
+1
source

Have you tried setting a transparent background for WebView and overlaying it on top of SurfaceView using FrameLayout ?

0
source

Add a surface view and webview to the frame, then mWebview.setBackgroundColor (0x00000000) works for me

0
source

Source: https://habr.com/ru/post/1341490/


All Articles