Giter Site home page Giter Site logo

cd031116 / intensifyimageview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minetsh/intensifyimageview

0.0 2.0 0.0 47.97 MB

Picture Preview Lib,用于显示原图级别的图片预览库,大图显示,大图预览,大图加载,类似微博长图,宽图,可用于显示大分辨率图片等。

Java 100.00%

intensifyimageview's Introduction

Android Picture Preview

一个用于大图预览的类库,可用于显示几十兆级别的图片,使图片在缩放过程中保持最佳清晰度。

单张图片的缩放加载 多张图片切换预览 ScaleType切换
单图预览 多图切换 ScaleType

Demo

安装 apk 文件预览效果,或者通过下面二维码去下载安装:

demo apk 文件地址二维码

Usage

Use Gradle:

dependencies {
   compile 'me.kareluo.intensify:image:1.1.0'
}

Or Maven:

<dependency>
  <groupId>me.kareluo.intensify</groupId>
  <artifactId>image</artifactId>
  <version>1.1.0</version>
  <type>pom</type>
</dependency>

Sample

布局文件如下,width和height都要使用match_parent:

<me.kareluo.intensify.image.IntensifyImageView
   android:id="@+id/intensify_image"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   app:scaleType="fitAuto" />

代码中可以通过以下三种方式设置图片资源:

IntensifyImageView imageView = (IntensifyImageView)findViewById(R.id.intensify_image);

// 通过流设置
imageView.setImage(InputStream inputStream);

// 通过文件设置
imageView.setImage(File file);

// 通过文件路径设置
imageView.setImage(String path);

Blog

大图预览的主要原理是通过BitmapRegionDecoder对图片进行分块加载实现的,并在内存中维护不同精度,不同区域的Bitmap对象的加载与回收,详细内容可参考此篇博客:Android 原图预览

Update Logs

v1.0.0

  • 图片分块加载
  • 支持多图切换
  • 双击缩放及手势缩放
  • 移动、快速滑动、回弹、居中等

v1.1.0

  • 支持ScrollBar
  • 添加CENTERCENTER_INSIDE
  • 优化缩放抖动问题
  • 添加ScaleType切换动画

License

Copyright 2015 kareluo.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

intensifyimageview's People

Contributors

minetsh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.