saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
2.99k stars 1.2k forks source link

Problem Draw anything over cameraview #162

Open rickliu65 opened 7 years ago

rickliu65 commented 7 years ago

have a problem to draw to com.serenegiant.widget.UVCCameraTextureView

Can you give me a tip to draw a line or circle or etc on MainActivity. it is my code ... but fail to draw on that view.

final View view = findViewById(R.id.camera_view); Bitmap imageBitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(imageBitmap); float scale = getResources().getDisplayMetrics().density; Paint p = new Paint(); p.setColor(Color.BLUE); p.setTextSize(24*scale); canvas.drawText("Hello", view.getWidth()/2,view.getHeight()/2, p); canvas.save(); view.draw(canvas); My issue is want to draw to cameraview (bitmapoverlay) . But I try all fail.

Thank you.

Rick

ldima commented 7 years ago

I think not big deal add simple view on R.id.camera_view and draw what you need inside.