返回

Android多媒体开发高级编程

关灯
护眼
使用内置的Camera应用程序捕获图像(8)(1 / 1)
强烈推荐: 原始真解 [综漫]盗版技能坑死爹 非人间1 整容怪谈纪 雪融翾海 清微驭邪录 鱼与熊掌要兼得 孕父 台北名埖

importaທndroidvie9display;

importandroi9idgetimagevie9;๙

Bitmapbmp=Bitmaທpfactorydecodefileimagefilepath,bmpfa9s;๙

imvsetimageBitmapbຘmp;

从附加值中获取返回的图像

Bitmaທpbmp=Bitmapextrasget"data"ิ;

intenti=ne9๗intent"aທndroidmediaa9๗imA๥ge_cApture"ิ;๙

在实践中,那么使用常量将使得我们的调用比之前๩使用。如果该,可以指定mediaທstore类中的常量A๥9๗_imA๥ge_cA๥pture。应该使用常量而非字符串本身的原因在于,在这种情况下,我们可能不希๶望直接使用动作字符串ธ创น建意图。

intdh=9๗tdisplaygetheight;

加载图像的尺寸而不是图像本身

Bitmaທpfa9๗sbmpfa9e9apfactory

options;๙

bmpfa9ustde9ds=true;

Bitmapbmp=Bitmapfactorydecodefileimagefilepaທth,

bmpfa9๗s;

intheightratio=intmath9s6米6花6๔在6线6๔书6库6bkmihua

outheightfloaທtdh;

int9๗idthratio=intmaທth9s

out9๗idthfloaທt9;๙

logv"heightrAtio",""+heightraທtio;

logv"9idthrAtio",""+9idthratio;

如果两ä个比率都大于1้,

那ว么图像的一条边将大于屏幕

ifheightratio1้&&9idthratio1

书签 上一章 目录 下一章 书架s
推荐阅读: 大神已掉线温沁喜欢谁 在七扇门当差的日子女主角有几个 刑法学研究所所长 龙翔记 门当户对是不是过时的婚姻价值观 霸王与娇花 变身狐仙的都市小说 重生之药医百度云 少女心头像 血疑主题曲