本文整理了Java中android.graphics.Camera.setLocation()
方法的一些代码示例,展示了Camera.setLocation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Camera.setLocation()
方法的具体详情如下:
包路径:android.graphics.Camera
类名称:Camera
方法名:setLocation
暂无
代码示例来源:origin: Ramotion/folding-cell-android
super.initialize(width, height, parentWidth, parentHeight);
this.mCamera = new Camera();
mCamera.setLocation(0, 0, -mCameraHeight);
代码示例来源:origin: Bilibili/DanmakuFlameMaster
private int saveCanvas(BaseDanmaku danmaku, Canvas canvas, float left, float top) {
camera.save();
if (locationZ !=0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
camera.setLocation(0, 0, locationZ);
}
camera.rotateY(-danmaku.rotationY);
camera.rotateZ(-danmaku.rotationZ);
camera.getMatrix(matrix);
matrix.preTranslate(-left, -top);
matrix.postTranslate(left , top);
camera.restore();
int count = canvas.save();
canvas.concat(matrix);
return count;
}
代码示例来源:origin: kakajika/FragmentAnimations
camera.save();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
camera.setLocation(mCameraX, mCameraY, mCameraZ);
代码示例来源:origin: sunnyxibei/HenCoderPractice
public MapView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MapView);
BitmapDrawable drawable = (BitmapDrawable) a.getDrawable(R.styleable.MapView_mv_background);
a.recycle();
if (drawable != null) {
bitmap = drawable.getBitmap();
} else {
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.flip_board);
}
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
camera = new Camera();
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
float newZ = -displayMetrics.density * 6;
camera.setLocation(0, 0, newZ);
}
代码示例来源:origin: CoderLengary/WanAndroid
public RotateView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.RotateView);
BitmapDrawable bitmapDrawable = (BitmapDrawable) array.getDrawable(R.styleable.RotateView_viewBackgound2);
array.recycle();
if (bitmapDrawable != null) {
bitmap = bitmapDrawable.getBitmap();
byte[] bytes = BitmapUtil.bitmap2Bytes(bitmap);
bitmap = BitmapUtil.resizeBitmapBytes(bytes);
}else {
bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
}
camera = new Camera();
paint = new Paint(Paint.ANTI_ALIAS_FLAG);
DisplayMetrics metrics = getResources().getDisplayMetrics();
float newZ = -metrics.density * 6;
camera.setLocation(0, 0, newZ);
}
代码示例来源:origin: stackoverflow.com
public static class CubeRotate extends Animation {
private Camera mCamera;
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
mCamera.setLocation(width, height * .5F, 0);
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
mCamera.rotateY(90f * interpolatedTime);
mCamera.getMatrix(t.getMatrix());
}
}
代码示例来源:origin: yiyuanliu/FlipGank
mCamera.setLocation(0f, 0f, -80);
mCamera.rotateX(mPercent * 180);
mCamera.getMatrix(mMatrix);
内容来源于网络,如有侵权,请联系作者删除!