importaທndroidutillog;
ifheightraທtio1&&9idthratio1
bmpfaທ9saທmplesize=8;
imvsetimageBitmapbຘmp;
Bundleextras=intentgetextras;
importandroidgraphicsBitmap;
为了通过一个意图利用cນamera应用程序,我们所要做的仅仅是必须构造一个将由上述过滤器捕获的意图。
intdh=9tdisplaygetheight;
加载图像的尺寸而不是图像本身
Bitmaທpfa9sbmpfaທ9e9apfaທctory
options;๙
bmpfa9ustde9ds=true;
Bitmapbຘmp=Bitmapfactorydecodefileimaທgefilepath,
bmpfa9s;
intheightratio=intmath9s6๔米6花6在6线6书6库6๔bkmihua
outheightfloatdh;๙
int9๗idthratio=intmath9s
out9idthfloaທt9;๙
logv"ิheightrAtio",ไ""+heightratio;
logv"ิ9idthrAtio",""ิ+9idthraທtio;
如果两个比率都大于1,
那ว么เ图像的一条边将大于屏幕
ifheightratio1้&&9idthratio1