简体   繁体   中英

setTransform () for SurfaceView

When recording via TextureView to the screen is not mirrored used setTransform () method:

Matrix txform = new Matrix();
mTextureView.getTransform(txform);
txform.setScale((float) newWidth / viewWidth, (float) newHeight / viewHeight);
txform.postTranslate(xoff, yoff);
mTextureView.setTransform(txform);

And in my case I use SurfaceView instead TextureView and it turns out there is this method ...

Question: What should I do in order to mirror does not reflect, and what to use instead setTransform ()?

为了在 Y 轴上进行镜像,请使用以下命令:

txform.setScale(-(float) newWidth / viewWidth, (float) newHeight / viewHeight, viewWidth / 2.f , 0);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM