I am currently having problems with multiple surface views and the clipping of one of the single views to get it to appear as a circle. It is best described in images:
So in this view i have 2 surface views, the full screen one which is showing a preview of the camera and then the top which is playing back a file with a MediaPlayer. I have gotten the top one to be above the preview with the following line:
surfaceView.setZOrderMediaOverlay(true);
Now as you can see i have attempted to mask this to a circle with the following code:
@Override
protected void dispatchDraw(Canvas canvas) {
Path clipPath = new Path();
clipPath.addCircle(getWidth() / 2, getHeight() / 2, getWidth() / 2, Path.Direction.CCW);
canvas.clipPath(clipPath);
super.dispatchDraw(canvas);
}
But it doesn't appear to have quite worked out. I initially thought this was a problem with my masking code but turns out the if i remove the preview surface view, like in the following image, the masking works fine
Anyone have any ideas as to why this is occurring or how to fix it at all :S?
Thanks for your help