文件名称:PictureDemo
介绍说明--下载内容均来自于网络,请自行研究使用
Android相机拍照、相册选取后直接显示以及截图后显示,解决因Bitmap导致的内存溢出问题,源码实现过程部分注释讲解:
将保存在本地的图片取出并缩小后显示在界面上、由于Bitmap内存占用较大,这里需要回收内存,否则会报out of memory异常、将处理过的图片显示在界面上,并保存到本地、使用ContentProvider通过URI获取原始图片、为防止原始图片过大导致内存溢出,这里先缩小原图显示,然后释放原始Bitmap占用的内存、释放原始图片占用的内存,防止out of memory异常发生、指定照片保存路径(SD卡),image.jpg为一个临时文件,每次拍照后这个图片都会被替换-Android camera to take pictures the album directly select screenshots solve the problem of memory overflow due to Bitmap lead after source implementation process part of the annotation to explain: Remove and out will be saved in the local picture is displayed in the interface due to the Bitmap memory footprint than large, need to reclaim memory, otherwise it will be reported out of memory exception, the pictures are displayed in the interface and saved to the local use the ContentProvider through URI to get the original picture, in order to prevent the original image is too large lead to memory overflow here first narrow the artwork display, and then to release the original Bitmap occupied the memory, to release the memory occupied by the original picture, to prevent out of memory exception occurs, the path of the specified save photos (SD Card) image.jpg to a temporary file, every time you take a photo picture will be replaced
将保存在本地的图片取出并缩小后显示在界面上、由于Bitmap内存占用较大,这里需要回收内存,否则会报out of memory异常、将处理过的图片显示在界面上,并保存到本地、使用ContentProvider通过URI获取原始图片、为防止原始图片过大导致内存溢出,这里先缩小原图显示,然后释放原始Bitmap占用的内存、释放原始图片占用的内存,防止out of memory异常发生、指定照片保存路径(SD卡),image.jpg为一个临时文件,每次拍照后这个图片都会被替换-Android camera to take pictures the album directly select screenshots solve the problem of memory overflow due to Bitmap lead after source implementation process part of the annotation to explain: Remove and out will be saved in the local picture is displayed in the interface due to the Bitmap memory footprint than large, need to reclaim memory, otherwise it will be reported out of memory exception, the pictures are displayed in the interface and saved to the local use the ContentProvider through URI to get the original picture, in order to prevent the original image is too large lead to memory overflow here first narrow the artwork display, and then to release the original Bitmap occupied the memory, to release the memory occupied by the original picture, to prevent out of memory exception occurs, the path of the specified save photos (SD Card) image.jpg to a temporary file, every time you take a photo picture will be replaced
(系统自动生成,下载前可以参看下载内容)
下载文件列表
PictureDemo\.classpath
...........\.project
...........\AndroidManifest.xml
...........\bin\AndroidManifest.xml
...........\...\classes\com\ryantang\picture\BuildConfig.class
...........\...\.......\...\........\.......\ImageTools.class
...........\...\.......\...\........\.......\MainActivity$1.class
...........\...\.......\...\........\.......\MainActivity$2.class
...........\...\.......\...\........\.......\MainActivity$3.class
...........\...\.......\...\........\.......\MainActivity.class
...........\...\.......\...\........\.......\R$attr.class
...........\...\.......\...\........\.......\R$dimen.class
...........\...\.......\...\........\.......\R$drawable.class
...........\...\.......\...\........\.......\R$id.class
...........\...\.......\...\........\.......\R$layout.class
...........\...\.......\...\........\.......\R$menu.class
...........\...\.......\...\........\.......\R$string.class
...........\...\.......\...\........\.......\R$style.class
...........\...\.......\...\........\.......\R.class
...........\...\classes.dex
...........\...\dexedLibs\android-support-v4-4a6c1b17fb6bbdc2f7bf876192587771.jar
...........\...\.........\android-support-v4-de039f076d28621ca83600c1602db8e7.jar
...........\...\.........\annotations-a6968887b4a4d8dc58c3ed4c47482f29.jar
...........\...\jarlist.cache
...........\...\PictureDemo.apk
...........\...\res\drawable-hdpi\ic_launcher.png
...........\...\...\.........mdpi\ic_launcher.png
...........\...\...\.........xhdpi\ic_launcher.png
...........\...\...\..........xhdpi\ic_launcher.png
...........\...\resources.ap_
...........\gen\com\ryantang\picture\BuildConfig.java
...........\...\...\........\.......\R.java
...........\ic_launcher-web.png
...........\libs\android-support-v4.jar
...........\proguard-project.txt
...........\project.properties
...........\res\drawable-hdpi\ic_launcher.png
...........\...\.........mdpi\ic_launcher.png
...........\...\.........xhdpi\ic_launcher.png
...........\...\..........xhdpi\ic_launcher.png
...........\...\layout\activity_main.xml
...........\...\menu\main.xml
...........\...\values\dimens.xml
...........\...\......\strings.xml
...........\...\......\styles.xml
...........\...\......-sw600dp\dimens.xml
...........\...\.........720dp-land\dimens.xml
...........\src\com\ryantang\picture\ImageTools.java
...........\...\...\........\.......\MainActivity.java
...........\bin\classes\com\ryantang\picture
...........\...\.......\...\ryantang
...........\gen\com\ryantang\picture
...........\src\com\ryantang\picture
...........\bin\classes\com
...........\...\res\drawable-hdpi
...........\...\...\drawable-mdpi
...........\...\...\drawable-xhdpi
...........\...\...\drawable-xxhdpi
...........\gen\com\ryantang
...........\src\com\ryantang
...........\bin\classes
...........\...\dexedLibs
...........\...\res
...........\gen\com
...........\res\drawable-hdpi
...........\...\drawable-ldpi
...........\...\drawable-mdpi
...........\...\drawable-xhdpi
...........\...\drawable-xxhdpi
...........\...\layout
...........\...\menu
...........\...\values
...........\...\values-sw600dp
...........\...\values-sw720dp-land
...........\src\com
...........\assets
...........\bin
...........\gen
...........\libs
...........\res
...........\src
PictureDemo