A
A
Andrey Golubkov2015-03-03 12:40:44
Java
Andrey Golubkov, 2015-03-03 12:40:44

How to draw on SurfaceView while showing a picture from the camera?

Interested in how I can get the Surfaceview canvas and draw on it.
It is required to draw while the camera is running (apply effects to the camera).
Like this, just on SurfaceView :

Canvas canvas = new Canvas(drawingBitmap);
    Paint paint = new Paint();
    canvas.drawBitmap(sourceBitmap, 0, 0, paint);
    paint.setXfermode(new PorterDuffXfermode (android.graphics.PorterDuff.Mode.SCREEN)); // способ смешивания
    canvas.drawBitmap(destinationBitmap, 0, 0, paint);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question