GithubHelp home page GithubHelp logo

ps-jimmy / image-zoom-view Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hsmnzaydn/image-zoom-view

1.0 1.0 0.0 214 KB

Imageview zoom library for android

License: Apache License 2.0

Java 100.00%

image-zoom-view's Introduction

image-zoom-view

Imageview zoom library for android. It's simple show image library.




Demo


Quick start

1) Add this library as a dependency in your app's build.project file.
  
allprojects {  
      repositories {  
         maven { url 'https://jitpack.io' }  
      }  
   }  
  

2) Add the view to your layout XML.

implementation 'com.github.hsmnzaydn:imagezoom:1.2.1'

3) Add the view to your layout XML.

<com.ozaydin.serkan.com.image_zoom_view.ImageViewZoom  
    android:layout_width="wrap_content"  
    android:layout_height="wrap_content"  
    android:src="@drawable/aleyna_fox" />

Features

Drawing as round

<com.ozaydin.serkan.com.image_zoom_view.ImageViewZoom  
            android:layout_width="wrap_content"  
             android:layout_height="wrap_content"  
             app:circle="true"  
             android:src="@drawable/aleyna_fox" />

Get ImageViewZoom's base64 decoded

Returns ImageViewZoom's base64
imageViewZoom.getBase64();  

Save Image As File

Step 1. Init ImageViewZoomConfig and set saveProperty field as "true"

ImageViewZoomConfig imageViewZoomConfig=new ImageViewZoomConfig();  
imageViewZoomConfig.saveProperty(true);

Step 2. Init "ImageViewZoomConfig.ImageViewZoomConfigSaveMethod" Note: If you want show save option to user only when open dialog you have to set "ImageViewZoomConfig.ImageViewZoomConfigSaveMethod" as "onlyOnDialog" If you want save image when run code you have to set "ImageViewZoomConfig.ImageViewZoomConfigSaveMethod" as "always".

ImageViewZoomConfig.ImageViewZoomConfigSaveMethod imageViewZoomConfigSaveMethod = ImageViewZoomConfig.ImageViewZoomConfigSaveMethod.onlyOnDialog; // You can use always
imageViewZoomConfig.setImageViewZoomConfigSaveMethod(imageViewZoomConfigSaveMethod);

Step 3. Set Config

imageViewZoom.setConfig(imageViewZoomConfig);

Step 4. Use "saveImage()" method

imageViewZoom.saveImage(MainActivity.this, "ImageViewZoom", "test", Bitmap.CompressFormat.JPEG, 1, imageViewZoomConfig,new SaveFileListener() {  
  @Override   
  public void onSuccess(File file) {  
     Toast.makeText(MainActivity.this,"Success",Toast.LENGTH_SHORT).show();
   }     
  @Override  
  public void onFail(Exception excepti) {  
    Toast.makeText(MainActivity.this,"Error Save",Toast.LENGTH_SHORT).show();  
  }  
});

Dependicies

Subsampling Scale Image View

image-zoom-view's People

Contributors

hsmnzaydn avatar

Stargazers

 avatar

Watchers

 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.