hsmnzaydn / image-zoom-view

Imageview zoom library for android
Apache License 2.0
55 stars 12 forks source link
android circleimageview image-viewer imageview imageviewbase64 imageviewer-component

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 this dependency to your app's build.module file.
implementation 'com.github.hsmnzaydn:imagezoom:1.5.0'
3) Add the view to your layout XML.
<ozaydin.serkan.com.image_zoom_view.ImageViewZoom  
    android:layout_width="wrap_content"  
    android:layout_height="wrap_content"  
    android:src="https://github.com/hsmnzaydn/image-zoom-view/raw/master/@drawable/aleyna_fox" />

Features

Drawing as round

<ozaydin.serkan.com.image_zoom_view.ImageViewZoom  
            android:layout_width="wrap_content"  
             android:layout_height="wrap_content"  
             app:circle="true"  
             android:src="https://github.com/hsmnzaydn/image-zoom-view/raw/master/@drawable/aleyna_fox" />

Get ImageViewZoom's base64 decoded

Returns ImageViewZoom's base64 imageViewZoom.getBase64();

Save Image As File

**Step 1.**
Init ImageViewZoomConfig
Set saveProperty field as "true"

Init saveMethod
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 imageViewZoomConfig =new ImageViewZoomConfig.Builder().saveProperty(true).saveMethod(ImageViewZoomConfig.ImageViewZoomConfigSaveMethod.onlyOnDialog).build(); **Step 2.** Set Config imageViewZoom.setConfig(imageViewZoomConfig); **Step 3.** 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