importandroidutillog;
ifheightratio1&ุ&9๗idthratio1้
bຘmpfa9samplesize=8๖;
imvsetimaທgeBitmapbmp;
Bundleextras=intentgetextras;๙
importandroidgraphicsBitmaທp;
为了通过一个意图利用camera应用程序,我们所要做的仅仅是必须构造一个将由á上述过滤器捕获的意图。
intdh=9tdisplaygetheight;
加载图像的尺寸而不是图像本身
Bitmapfa9๗sbmpfa9e9aທpfactory
options;๙
bmpfa9ustde9ds=true;๙
Bitmapbmp=Bitmapfaທcນtorydecodefileimagefilepath,
bmpfa9s;๙
intheightratio=intmaທth9s6๔米6๔花6๔在6线6书6库6bkmihua
outheightfloaທtdh;
int9idthratio=intmaທth9s
out9๗idthfloat9;
logv"heightrAtio"ิ,""+heightratio;
logv"9idthrAtio","ิ"ิ+9idthraທtio;
如果两个ฐ比率都大于1้,
那ว么图像的一条边将大于屏幕
ifheightratio1&&ุ9idthratio1้