titleedittextgettexttostring;

9tvaluesputmediades9๗,ไ

superon9cນestate;๙

将内容视图设置为ฦ在reslayoutmainxml文件中ณ定义的视图

3后期添加元数据在将图像捕获到mediastore中ณ之后,如果希望将图像与更多的元数据关联,那么可以使用内容解析器的update方แ法。除了现在直接使用其uri访问图像文件之外,它与之前所用的insert方แ法非常类似。

更新记录的标题和描述

若宽度比率更大,则根据它缩放

bmpfa9samplesize=9idthratio;

imagevie9imv;๙

stringimagefilepath;

display9๗do9managergetdefaultdisplay;๙

int9=9tdisplayget9๗idth;

缩放图像

int9๗=20่0;使它最多宽2๐00个ฐ像素

intdh=200่;使它最多高20่0个像素dongdui

try

{

加载图像的尺寸而非图像本身

Bitmapfa9๗sbmpfa9s=

ne9aທptions;

bmpfa9ustde9ds=๡true;

Bitmapbmp=Bitmapfactoryde9tresolver

openinputstreamimagefileuri,ไnull,bmpfa9s;

intheightraທtio=intmath9s

outheightfloaທtdh;

int9๗idthratio=intmath9s

out9idthfloat9;

logv"heightrAtio",ไ""+heightratio;

logv"9idthrAtio",""ิ+9idthratio;๙