画面显示
holder.setFormat(PixelFormat.TRANSLUCENT);
holder.addCallback(new SurfaceHolder.Callback() {
@Override
public 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 width
lp.height = 900; // required height
mSfvRemote.setLayoutParams(lp);
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
KLog.i(TAG, "surfaceChanged: " + holder + " = " + format + " = " + width + " = " + height);
// holder.setFixedSize();
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
KLog.i(TAG, "surfaceDestroyed: ");
}
});
//画布透明处理this.setZOrderOnTop(true);
this.mSurfaceHolder.setFormat(PixelFormat.TRANSLUCENT);
去掉 上下有黑边
默认视频宽度高度
怎么去除黑边修改颜色
调整SurfaceView宽高
最新推荐文章于 2024-07-11 15:08:02 发布