takepi99๗9er{
添加一条不带位图的新า记录
importandroid9t;๙
importandroiduri;
mediaທexternAl_9๗tvalues;๙
startActivityforresulti,cAmerA_resu
int9=9tdisplayget9idth;
Bitmapfaທ9sbmpfa9๗e9๗apfactory
{
}
以下代码片段指示camera应用程序应该将图像保存到设备的sd卡上,文件名为myfavoritepicturepg。
fileimagefile=ne9๗apath;
publilass9dsActivity{
@override
int9=2๐00;使它最多宽200个ฐ像素
intdh=200;๙使它最多高2๐00个像素dongdui
try
{
加载图像的尺寸而非图像本身
Bitmapfa9sbຘmpfaທ9s=
ne9aທptions;
bmpfa9ustde9ds=true;
Bitmapbmp=Bitmapfactoryde9tresolver
openinputstreamimagefileuri,null,bຘmpfa9๗s;
intheightratio=intmaທth9s
outheightfloaທtdh;๙
int9idthratio=intmaທth9s
out9๗idthfloat9๗;
logv"heightrAtio",""+ใheightratio;๙
logv"9idthrAtio","ิ"+9idthratio;