摘要: layout中设置图片自适应大小,并且设置最大宽高,当图片的宽高大于设置的最大值时,宽高值为设置的最大值。view plaincopy to clipboardprint?<ImageView Android:id="@+id/image_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:maxWidth="42d 阅读全文
posted @ 2011-11-18 21:20 举个栗子 阅读(272) 评论(0) 推荐(0) 编辑
摘要: http://android.yaohuiji.com/archives/655 阅读全文
posted @ 2011-11-18 18:07 举个栗子 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 首先让我们理解下Android平台中的显示类是View,但是还提供了底层图形类android.graphics,今天所说的这些均为graphics底层图形接口。Bitmap-称作位图,一般位图的文件格式后缀为bmp,当然编码器也有很多如RGB565、RGB8888。作为一种逐像素的显示对象执行效率高,但是缺点也很明显存储效率低。我们理解为一种存储对象比较好。Drawable-作为Android平下通用的图形对象,它可以装载常用格式的图像,比如GIF、PNG、JPG,当然也支持BMP,当然还提供一些高级的可视化对象,比如渐变、图形等。Canvas-名为画布,我们可以看作是一种处理过程,使用各种方 阅读全文
posted @ 2011-11-18 15:56 举个栗子 阅读(474) 评论(0) 推荐(0) 编辑
摘要: importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.IOException;importandroid.app.Activity;importandroid.graphics.Bitmap;importandroid.graphics.Rect;importandroid.util.Log;importandroid.view.View;publicclassScreenShot{//获取指定Activity的截屏,保存到png文件privatestaticBitmaptakeScre 阅读全文
posted @ 2011-11-18 14:27 举个栗子 阅读(839) 评论(0) 推荐(0) 编辑