Giter Club home page Giter Club logo

viewtoimage's Introduction

ViewToImage

Introduce

本demo目标想做成网易云音乐歌词分享,动态生成文字+图片。支持已渲染的和未渲染(inflate)的视图,inflate出来的不要使用margin!!! 已渲染的view无此bug

Feature

  • 根据View生成Bitmap,保存图片
  • 支持ListView生成超过一屏的长图
  • 支持inflate出来的view生成Bitmap,保存图片

Not support now

  • 不支持RecyclerView, ScrollView, GridView
  • 不支持过复杂嵌套的ListView
  • inflate view中margin信息可能会丢失

截图

应用主界面

应用主界面

保存的长截图

保存的长截图

内存截图

在720x1280 320dp模拟器上测试内存占用图 保存的长截图

初始状态应用占用4M, 截图后应用占用20M, 3.5个屏幕大小截图大约16M,并不会导致OOM,并且截图后内存及时回收~,不会导致内存问题

体验包

体验包

Blog

todo

Android机上图片down到本地

adb pull /sdcard/123/20160120_035750.jpg art

Ref

android Bitmap(将视图转为bitmap对象) Android学习笔记进阶18之画图并保存图片到本地 http://stackoverflow.com/questions/12742343/android-get-screenshot-of-all-listview-items Android中View转换为Bitmap及getDrawingCache=null的解决方法

viewtoimage's People

Contributors

huazhiyuan2008 avatar

Watchers

James Cloos 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.