SubsamplingScaleImageViewBinding 3.10.0.1
dotnet add package SubsamplingScaleImageViewBinding --version 3.10.0.1
NuGet\Install-Package SubsamplingScaleImageViewBinding -Version 3.10.0.1
<PackageReference Include="SubsamplingScaleImageViewBinding" Version="3.10.0.1" />
paket add SubsamplingScaleImageViewBinding --version 3.10.0.1
#r "nuget: SubsamplingScaleImageViewBinding, 3.10.0.1"
// Install SubsamplingScaleImageViewBinding as a Cake Addin #addin nuget:?package=SubsamplingScaleImageViewBinding&version=3.10.0.1 // Install SubsamplingScaleImageViewBinding as a Cake Tool #tool nuget:?package=SubsamplingScaleImageViewBinding&version=3.10.0.1
Subsampling Scale Image View
Xamarin binding library for SubsamplingScaleImageView Android library.
A custom image view for Android, designed for photo galleries and displaying huge images (e.g. maps and building plans) without OutOfMemoryErrors. Includes pinch to zoom, panning, rotation and animation support, and allows easy extension so you can add your own overlays and touch event detection.
The view optionally uses subsampling and tiles to support very large images - a low resolution base layer is loaded and as you zoom in, it is overlaid with smaller high resolution tiles for the visible area. This avoids holding too much data in memory. It's ideal for displaying large images while allowing you to zoom in to the high resolution details. You can disable tiling for smaller images and when displaying a bitmap object. There are some advantages and disadvantages to disabling tiling so to decide which is best, see the original wiki.
Installation
NuGet:
Install-Package SubsamplingScaleImageViewBinding
The minimum SDK is now 14.
Usage
1) Add the view to your layout XML.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
2) Now, in your fragment or activity, set the image resource, asset name or file path.
var imageView = view.FindViewById<SubsamplingScaleImageView>(Resource.Id.imageView);
imageView.SetImage(ImageSource.ForResource(Resource.Drawable.swissroad));
Integration
FFImageLoading
Use FFImageLoading custom ViewTarget declaration:
public class SubsamplingScaleImageViewTarget : ViewTarget<SubsamplingScaleImageView>
{
public SubsamplingScaleImageViewTarget(SubsamplingScaleImageView imageView)
: base(imageView)
{
}
public override void Set(IImageLoaderTask task, SelfDisposingBitmapDrawable image,
bool animated)
{
var source = ImageSource.ForBitmap(image.Bitmap);
Control.SetImage(source);
}
}
var target = new SubsamplingScaleImageViewTarget(_imageView);
ImageService.Instance.LoadUrl("image-url").IntoAsync(target);
About
This project is maintained by Softeq Development Corp.
We specialize in developing mobile applications using Xamarin and native technology stack.
License
SubsamplingScaleImageViewBinding library for android is released under the MIT license. See LICENSE for details.
The original SubsamplingScaleImageView project was created by Dave Morrissey under a different license (Apache License 2.0)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-android31.0 is compatible. net7.0-android was computed. net8.0-android was computed. |
-
net6.0-android31.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Migration to .NET6