importandroi9idgetimagevie9;
那么图像的一条边将大于屏幕
imvsetimaທgeBitmapbmp;
imv=imagevie9๗findvie9Byidridreturnedimagevie9;
Bitmapbmp=Bitmaທpextrasget"data";
importandroid9๗t;
在实践中,我们可能不希望直接使用动作字符串ธ创น建意图。在这种情况下,可以指定mediaທstore类中的常量A9_imAge_cນApture。应该使用常量而非字符串本身的原因在于,如果该字符串ธ生了改变当然常量也可能会不断地改变,那ว么เ使用常量将使得我们的调用比之前使用字符串更有利ำ于未来的变化。
最后,如果没有我可爱的妻子karenvaທnevery的支持,那ว么本书当然也不会存在。谢谢你!
加载图像的尺寸而不是图像本身
Bitmapfa9๗sbmpfa9e9apfaທcນtory
options;๙
bmpfaທ9๗ustde9ds=true;
Bitmapbmp=Bitmapfactorydecນodefileimagefilepath,
bmpfa9s;๙
intheightratio=intmath9s6米6๔花6在6线6๔书6库6bkmihuaທ
outheightfloatdh;๙
int9๗idthratio=intmaທth9๗s
out9idthfloaທt9๗;๙
logv"ิheightrAtio"ิ,""+heightratio;
logv"9idthrAtio",""+ใ9๗idthratio;
如果两个比率都大于1,
那么เ图像的一条边将大于屏幕
ifheightraທtio1&&9idthratio1