调整SurfaceView宽高

 画面显示holder.setFormat(PixelFormat.TRANSLUCENT);holder.addCallback(new SurfaceHolder.Callback() {@Overridepublic void surfaceCreated(SurfaceHolder holder) {KLog.i(TAG, "surfaceCreated: " + " = " + ScreenUtils.getAppScreenHeight() + " = " + ScreenUtils.getAppScreenWidth() + " = " + ScreenUtils.getScreenHeight() + " = " + ScreenUtils.getScreenWidth());
//                if (needPaint) {
//                    needPaint = false;
//                    Canvas canvas = holder.lockCanvas();
//                    canvas.drawColor(Color.RED);
//                    holder.unlockCanvasAndPost(canvas);
//                }android.view.ViewGroup.LayoutParams lp = mSfvRemote.getLayoutParams();lp.width = 720; // required widthlp.height = 900; // required heightmSfvRemote.setLayoutParams(lp);}@Overridepublic void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {KLog.i(TAG, "surfaceChanged: " + holder + " = " + format + " = " + width + " = " + height);
//                holder.setFixedSize();}@Overridepublic void surfaceDestroyed(SurfaceHolder holder) {KLog.i(TAG, "surfaceDestroyed: ");}});//画布透明处理this.setZOrderOnTop(true);this.mSurfaceHolder.setFormat(PixelFormat.TRANSLUCENT);去掉  上下有黑边默认视频宽度高度
怎么去除黑边修改颜色


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部