- 16
- 0
- 约4.81千字
- 约 19页
- 2017-03-26 发布于贵州
- 举报
android图片处理android图片处理
Android 图形处理专题 Load图形到内存 Load图形到内存 Load图形到内存2 获取Exif图片信息 从gallery获取一个图片 创建bitmap拷贝 图形缩放 图形旋转 图形平移 镜子效果 倒影效果 图像颜色处理 变换图像的亮度 更改图片饱和度 图片合成 按指定path上绘制文字 图片编辑画画板 人脸识别 FaceDetector detector = new FaceDetector(faceBitmap.getWidth(), faceBitmap.getHeight(), 3); // 创建识别器 mNumFaces = detector.findFaces(faceBitmap, mFaces); // 识别 if (mNumFaces 0) { for (int i = 0; i mNumFaces; i++) { handleFace(mFaces[i]); // 调用函数对人脸画面进行处理 } } * * 1.数码相机照片特别大3m以上,内存吃不消,只显示原图的1/8 通过BitmapFactory.Options 来实现 BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options(); bmpFactoryOptions.inSampleSize = 8; Bitmap bmp = BitmapFactory.decodeFile(imageFilePath, bmpFactoryOptions); imv.setImageBitmap(bmp); 2.根据当前屏幕分辨率的大小,加载图片 Display currentDisplay = getWindowManager().getDefaultDisplay(); int dw = currentDisplay.getWidth(); int dh = currentDisplay.getHeight(); BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options(); bmpFactoryOptions.inJustDecodeBounds = true; Bitmap bmp = BitmapFactory.decodeFile(imageFilePath, bmpFactoryOptions); int heightRatio = (int)Math.ceil(bmpFactoryOptions.outHeight/(float)dh); int widthRatio = (int)Math.ceil(bmpFactoryOptions.outWidth/(float)dw); Log.v(HEIGHTRATIO,+heightRatio); Log.v(WIDTHRATIO,+widthRatio); //判断是否要进行缩放 if (heightRatio 1 widthRatio 1) { if (heightRatio widthRatio) { //高度变化大,按高度缩放 bmpFactoryOptions.inSampleSize = heightRatio; } else { // 宽度变化大,按宽度缩放 bmpFactoryOptions.inSampleSize = widthRatio; } } bmpFactoryOptions.inJustDecodeBounds = false; bmp = BitmapFactory.decodeFile(imageFilePath, bmpFactoryOptions); //从文件获取exif信息 ExifInterface ei = new ExifInterface(imageFilePath); String imageDescription = ei.getAttribute(ImageDescription); if (imageDescription != null) { Log.v(EXIF, imageDescription); } //把exif信息写到文件: ExifInterface ei = new ExifInterface(imageFilePath); ei.setAttribute(ImageDescription,Something New); Intent intent = new Intent(Inten
您可能关注的文档
最近下载
- 德州职业技术学院单招职业技能测试参考试题库(含答案).docx VIP
- SolidWorks-全套入门教程PPT课件.pptx VIP
- 2025年加州驾照常考题库及答案.doc VIP
- SYT5695-2017 钻井液用降黏剂 两性离子聚合物.pdf VIP
- 高中数学第二章随机变量及其分布章末复习课件新人教A版选修.pptx VIP
- ZBTB18控制胼胝体投射神经元的命运选择和进化.docx VIP
- 氯醇法年产20万吨环氧丙烷精馏工序工艺设计.docx VIP
- 2025年山东省春季高考信息技术类专业知识试题(打印版) .pdf VIP
- SY∕T 5612-2018 石油天然气钻采设备 钻井液固相控制设备规范.docx VIP
- 医院病房楼改造项目初步设计(范文).docx
原创力文档

文档评论(0)