当前位置: 首页 > news >正文

做电影网站要怎么拿到版权资源下载网站建设

做电影网站要怎么拿到版权,资源下载网站建设,360手机助手,公司做网站怎么收费1.相机过渡界面方向旋转 Android 10 - 相机过渡界面默认角度 同A10 有些区别,再次增加记录修改。 这个文件没有修改,只是说明 src/com/android/camera/CameraActivity.javaprivate void freezeScreenCommon(boolean async) {long startTime System.…

1.相机过渡界面方向旋转 

Android 10 - 相机过渡界面默认角度

同A10 有些区别,再次增加记录修改。

这个文件没有修改,只是说明
src/com/android/camera/CameraActivity.javaprivate void freezeScreenCommon(boolean async) {long startTime = System.currentTimeMillis();mCameraAppUI.setModeCoverState(1);mStartTime = startTime;if (mCurrentModule.isUseSurfaceView()) {Bitmap screenShot = getSurfaceViewBitmap();if (screenShot == null) {freezeScreenUntilPreviewReady();//SPRD:fix bug1116034} else {//CameraUtil.saveBitmapToFile(screenShot);// 经过注释验证,将下面的两个方法注释,就不会显示过渡画面screenShot = CameraUtil.blurBitmap(CameraUtil.computeScale(screenShot, 0.2f), mAppContext);mCameraAppUI.freezeScreenUntilPreviewReady(screenShot, async);}} else {freezeScreenUntilPreviewReady(async);}Log.i(TAG, "freezeScreenCommon cost: " + (System.currentTimeMillis() - startTime));}
src/com/android/camera/util/CameraUtil.java// 旋转 Bitmap 的辅助方法
private static Bitmap rotateBitmap(Bitmap source, float angle) {if (source == null) {return null;}Log.d(TAG, "Original width: " + source.getWidth() + ", height: " + source.getHeight());Matrix matrix = new Matrix();matrix.postRotate(angle);Bitmap rotatedBitmap = Bitmap.createBitmap(source,0, 0,source.getWidth(),source.getHeight(),matrix,true);// 打印旋转后图片宽高Log.d(TAG, "Rotated width: " + rotatedBitmap.getWidth() + ", height: " + rotatedBitmap.getHeight());return rotatedBitmap;
}public static Bitmap blurBitmap(Bitmap bitmap, Context context) {if (bitmap == null) {return null;}long startMs = System.currentTimeMillis();// 这里是新增加的方法,实现过渡画面的角度,当前项目旋转90度即可bitmap = rotateBitmap(bitmap, 90);// Instantiate a new RenderscriptRenderScript rs = RenderScript.create(context);
src/com/android/camera/app/CameraAppUI.javapublic void freezeScreenUntilPreviewReady(Bitmap bitmap, boolean async) {Log.v(TAG, "freezeScreenUntilPreviewReady bitmap=" + bitmap + "; async=" + async + " getPreviewArea :" + getPreviewAreaLocal());// lichang 修改原有获取预览区域方法为自行获取,原尺寸异常freezeScreen(bitmap, getPreviewAreaLocal(), async);}/*** 根据宽高比获取预览区域*/public RectF getPreviewAreaLocal() {Log.v(TAG, "getPreviewAreaLocal getAspectRation() = " + getAspectRation());float previewWidth = 960f;float screenWidth = 1280f;float aspectRation = getAspectRation();float epsilon = 0.001f; // 允许的误差范围if (Math.abs(aspectRation - (4f / 3f)) < epsilon) {// 4:3 比例(≈1.333)previewWidth = 960f;} else if (Math.abs(aspectRation - (16f / 9f)) < epsilon) {// 16:9 比例(≈1.777)previewWidth = 1280f;} else {// 其他比例,默认值或错误处理previewWidth = 1280f; // 或 throw new IllegalArgumentException("Unsupported aspect ratio");}float left = (screenWidth - previewWidth) / 2f;Log.v(TAG, "getPreviewAreaLocal left = " + left + " right = " + left + previewWidth);return new RectF(left, 0f, left + previewWidth, 720f);}// 新增方法public float getAspectRation() {return mTextureViewHelper.getAspectRation();}
src/com/android/camera/TextureViewHelper.javapublic void setAspectRation(float aspectRation) {mAspectRatio = aspectRation;}// 新增方法,获取当前宽高比public float getAspectRation() {return mAspectRatio;}

2.相机图标位置居中

+++ b/src/com/android/camera/ui/ModeTransitionView.java
@@ -143,6 +143,7 @@ public class ModeTransitionView extends View {mIconDrawable.setAlpha(alpha);}}
+           Log.e(TAG, " updateShade mWidth = " + mWidth + " mHeight = " + mHeight);invalidate();}}
@@ -172,6 +173,7 @@ public class ModeTransitionView extends View {@Overridepublic void onDraw(Canvas canvas) {
+       Log.e(TAG, " lichang  onDraw ");if (mAnimationType == PEEP_HOLE_ANIMATION) {canvas.drawColor(mBackgroundColor);if (mPeepHoleAnimator != null) {
@@ -227,8 +229,9 @@ public class ModeTransitionView extends View {mWidth = displaySize.getWidth();mHeight = displaySize.getHeight();boolean landscape = mWidth > mHeight;
-        int centerW = landscape ? mHeight : mWidth;
-        int centerH = landscape ? mWidth : mHeight;
+       // lichang 横屏也不需要调换位置,修改打开相机显示的图标位置
+        int centerW = !landscape ? mHeight : mWidth;
+        int centerH = !landscape ? mWidth : mHeight;if (CameraUtil.hasCutout()) {centerH -= CameraUtil.getCutoutHeight();

3.预览画面居中

默认4:3,显示的预览画面偏移,需要重新计算位置。

+++ b/src/com/android/camera/SurfaceViewEx.java
@@ -19,6 +19,8 @@package com.android.camera;+import android.util.DisplayMetrics;
+import android.view.WindowManager;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;
@@ -165,8 +167,16 @@ public class SurfaceViewEx extends SurfaceView {params.height = (int) scaledTextureHeight;RectF rect = mCameraAppUI.getPreviewArea();// horizontal direction
-                    params.setMargins((int) rect.left, (int) rect.top, 0, 0);
-
+                    //params.setMargins((int) rect.left, (int) rect.top, 0, 0);
+                   // lichang 将预览画面居中
+                   /*@start*/
+                   DisplayMetrics displayMetrics = new DisplayMetrics();
+                    ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(displayMetrics);
+                    int screenWidth = displayMetrics.widthPixels;
+                    int screenHeight = displayMetrics.heightPixels;
+                    Log.i(TAG, "setTransformMatrix(): screenWidth = " + screenWidth + " screenHeight = " + screenHeight);
+                   params.setMargins((int) (screenWidth - scaledTextureWidth) / 2, (int) (screenHeight - scaledTextureHeight) / 2, 0, 0);
+                   /*end*/setLayoutParams(params);Log.i(TAG, "setTransformMatrix(): width = " + previewWidth

 

http://www.dtcms.com/a/467288.html

相关文章:

  • 佛山找企业的网站苏州实力做网站公司有哪些
  • 网站技术策划人员要求怎么搞到网站
  • 在 tinkinter 中 label 标签的 font 属性有哪几种形式设置?
  • wordpress友情链接激活seo关键词
  • 晋城网站制作公司怎么选wordpress 最新一片文章
  • 淄博市沂源县城乡建设局网站wordpress 删除 wordpress.org
  • 阿里云怎么放多个网站wordpress微信拦截
  • 餐饮营销型网站案例分析域名注册查询阿里云
  • 单位网站怎么做2021年uc秒懂网址
  • 高端个性化网站开发室内设计学校排行榜
  • 上海建设银行网站市场营销策略分析论文
  • Linux学习笔记--POLL_SELECT方式读取输入数据
  • STM32项目分享:基于智能电扇的设计与实现
  • 大兴智能网站建设哪家好陕西宁德建设工程有限公司网站
  • 没有网站可以域名备案吗wordpress安装后只有英文
  • 网站和网页的设计方法南翔做网站公司
  • 外贸网络推广价格seo值是什么意思
  • 简单商业网站模板找网站公司制作网站
  • Unity Mask镂空效果(常用于新手引导或高亮显示UI元素)
  • 网站名是什么免费视频网站大全
  • Unity实现圆柱螺旋曲线运动方程
  • wordpress企业建长沙关键词优化新报价
  • 学习爬虫第五天:自动化爬虫
  • 专业的网站建设制作服务wordpress注册字段
  • 有关网站备案号规则怎么设计网站规划方案
  • 兰州网站建设推荐q479185700顶你做阀门网站电话
  • 怎么制作微信购物网站怎么开发手机app
  • 广州翼讯资讯科技有限公司 网站wordpress更换主题白屏
  • php网站开发模式有哪些网页设计与网站建设的概述
  • 网站风格细节dede增加手机网站