android中Imageview的布局和使用
布局:
<ImageView
android:id="@+id/imt_photo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp" >
</ImageView>
初始化和简单的使用:
private ImageView imageView;
imageView= (ImageView) findViewById(R.id.imt_photo);
imageView.setImageBitmap(pic); // 这个ImageView是拍照完成后显示图片 private static String photoPath = "/sdcard/AnBo/";
private static String photoName = photoPath + "laolisb.jpg";
BitmapFactory.Options op = new BitmapFactory.Options();
op.inSampleSize = 4; // 这个数字越大,图片大小越小,越不清晰
Bitmap pic = null;
pic = BitmapFactory.decodeFile(photoName, op); //从指定的地方获取图片
imageView.setImageBitmap(pic); //显示图片信息
android中Imageview的布局和使用的更多相关文章
- Android中的五大布局
Android中的五大布局 1.了解布局 一个丰富的界面总是要由很多个控件组成的,那我们如何才能让各个控件都有条不紊地 摆放在界面上,而不是乱糟糟的呢?这就需要借助布局来实现了.布局是一种可用于放置很 ...
- Android中的LinearLayout布局
LinearLayout : 线性布局 在一般情况下,当有很多控件需要在一个界面列出来时,我们就可以使用线性布局(LinearLayout)了, 线性布局是按照垂直方向(vertical)或水平方向 ...
- android中ImageView的ScaleType属性
android中ImageView的ScaleType属性 ScaleType的值分别代表的意义: ImageView是Android中的基础图片显示控件,该控件有个重要的属性是ScaleType,该 ...
- android中的常用布局管理器(三)
接上篇博客 (5)TableLayout 表格布局管理器 在android中,线性布局和表格布局用的是最多的. 在很多的输出操作中,往往会使用表格的形式对显示的数据进行排版,tablelayo ...
- Android中常用的布局
一般分为5大类. Android中所有的空间第一字母都是大写 1.线性布局 LinearLayout 2.相对布局 RelativeLayout 3.帧布局--分层显示 FrameLayout 4. ...
- Android中的五大布局和logcat打印日志
在android中的布局有五大类,有的时候你可能用到一种,但有的时候你也可能需要两种或者三种布局同时一起使用.这五种布局为别为:LinearLayout(线性布局),FrameLayout(框架布局) ...
- android中ImageView讲解
1.看布局文 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns ...
- Android中的六大布局
继承关系图: 布局XML文件中常用属性: android:layout_width 宽度 android:layout_height 高度 可能的取值为match_parent,wrap_conte ...
- android中的五大布局(控件的容器,可以放button等控件)
一.android中五大布局相当于是容器,这些容器里可以放控件也可以放另一个容器,子控件和布局都需要制定属性. 1.相对布局:RelativeLayout @1控件默认堆叠排列,需要制定控件的相对位置 ...
随机推荐
- RNN回归
import torch from torch import nn import numpy as np import matplotlib.pyplot as plt # torch.manual_ ...
- 【C++11】unoedered_map和map(部分转载)
1.结论 新版的hash_map都是unordered_map了,这里只说unordered_map和map. 运行效率:unordered_map最高,而map效率较低但提供了稳定效率和有序的序列. ...
- C#中上下文Context的理解
上下文指的是 进程间占有的资源空间. 当一个进程时间片到了或者资缺的时候就会让出cpu 当另一个进程开始始用CPU之前,系统要保存即将退出进程的执行状态,以便轮到时间片或有资源的时候现场恢复.这就所谓 ...
- 关于npm镜像,发布,内网搭建等
npm config set registry http://registry.npmjs.org npm config set registry https://registry.npm.taoba ...
- SpringBoot 上传文件夹
前端代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- 无法获得VMCI驱动程序的版本:句柄无效
解决方法: 查找到 vmci0.present="TRUE" 代码,将TRUE更改为FALSE保存即可
- 烧写uboot和openwrt固件ARxx系列
以AR9331为例. 1.用烧录器将uboot烧写到flash中 (AR9331_U-Boot_Oolite-v1-v20170713.bin) 2.登录:192.168.1.1网页烧写uboot ...
- pip包导出
用pip对已有的环境做导出准备 1. 使用pip导出当前环境所有依赖包信息文件 pip freeze > requirements.txt 2. 下载所有依赖包到本地 pip install - ...
- Python 官方文档解读(1):66 个内置函数
Python 解释器 (CPython 3.7)内置有 66 个函数,这些函数在任何时刻都是可用的.此文是为了对这 66 个函数进行简单的梳理,便于以后可能用到它们时能想到. 1. abs(x) 返回 ...
- sql server按月份,按项目号展开表格
原始数据: 01 RD21 6495.411402 RD21 87.43604 RD21 101.718405 RD21 1.538401 RD25 7803.303709 RD25 106.8375 ...