titleedittextgettexttostring;
9tvaluesputmediades9๗,ไ
superon9cນestate;๙
将内容视图设置为ฦ在reslayoutmainxml文件中ณ定义的视图
3后期添加元数据在将图像捕获到mediastore中ณ之后,如果希望将图像与更多的元数据关联,那么可以使用内容解析器的update方แ法。除了现在直接使用其uri访问图像文件之外,它与之前所用的insert方แ法非常类似。
更新记录的标题和描述
若宽度比率更大,则根据它缩放
bmpfa9samplesize=9idthratio;
imagevie9imv;๙
stringimagefilepath;
display9๗do9managergetdefaultdisplay;๙
int9=9tdisplayget9๗idth;
缩放图像
int9๗=20่0;使它最多宽2๐00个ฐ像素
intdh=200่;使它最多高20่0个像素dongdui
try
{
加载图像的尺寸而非图像本身
Bitmapfa9๗sbmpfa9s=
ne9aທptions;
bmpfa9ustde9ds=true;
Bitmapbmp=Bitmapfactoryde9tresolver
openinputstreamimagefileuri,ไnull,bmpfa9s;
intheightraທtio=intmath9s
outheightfloaທtdh;
int9๗idthratio=intmath9s
out9idthfloat9;
logv"heightrAtio",ไ""+heightratio;
logv"9idthrAtio",""ิ+9idthratio;๙