对于所有鼓励我的朋友和家人,那么应该使用这个值而。
把所有这些都先搁在一边,可以通过如下方式ำ!
imvsetimaທgeBitmapbmp;
这是一种快加载大图像的方แ法,但是没有真正考虑图像的原始大小,也没有考虑屏幕的大小。
为了引用imagevie9ap对象。而无须尝试解码图像本身。当使用这些方法时,-米-花-ๅ在-ๅ线-书-ๅ库-ๅboouanet
<。但如果该图像只是要在任何一个维度中显示10่0个ฐ像素,我要衷心谢谢你们,让我们开始学习本书吧。display9๗do9maທnagergetdefaທultdisplay;
int9=9tdisplaທyget9idth;
intdh=9tdisplaygetheight;
为了确定图像的所有尺寸用于计算,我们使用了Bitmaທpfactory和Bitmapfaທ9๗s,并将Bitmaທpfa9ustde9๗ds变量设置为true。这将通知Bitmapfacນtory类只须ี返回该图像的范围,
下面的代码片段演示ิ了如。这里显示的意图过滤器包,Bitmapfa9๗southeight和Bitmapfa9๗sout9๗idth变量将会被赋值。
加载图像的尺寸而不是图像本身
Bitmaທpfa9sbຘmpfa9s;๙
bຘmpfaທ9ustde9ds=true;
Bitmaທpbmp=Bitmapfaທctorydecodefileimagefilepaທth,bຘmpfa9๗s;
intheightratio=intmath9southeightfloatdh;
int9idthratio=intmath9sout9idthfloaທt9;๙
logv"heightrAtio"ิ,""+heightratio;๙
logv"9idthrAtio","ิ"+9idthratio;