Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple example of how to use the Zoom Area Cropper in a view.
@inherits UmbracoTemplatePage
@using ZoomAreaCropper.Models
@{
Layout = null;
}
@if (Model.Content.HasValue("photo"))
{
var photo = Model.Content.GetPropertyValue<ZoomAreaCropper>("photo");
if (photo.HasMedia)
{
@* Displays the original image as IPublished Content *@
<img src="@photo.Media.Url" />
}
if (photo.HasCrops)
{
foreach (var crop in photo.Crops)
{
if (crop.IsValid)
{
@* Displays pre-cropped images based on the original media items using ImageProcessor *@
<img src="@crop.Url" />
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment