Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thomas Beckert 193 posts 469 karma points
    Apr 23, 2020 @ 10:49
    Thomas Beckert
    0

    Using ImageCropper Datatype as Property

    Hi,

    I setup an Image Cropper Datatype and use it as Property in my DocumentType.

    Now, the return-Value looks like this:

    {{"src":"/media/ke4jskoy/testbild.jpg","focalPoint":{"left":0.5,"top":0.5},"crops":[{"alias":"StoererBild","width":145,"height":200,"coordinates":{"x1":0.18885757398753891,"y1":0.0,"x2":0.13131376557632407,"y2":0.0}}]}}
    

    Any idea, how to get the crop out of this? The crop alias is "StoererBild".

    Thanks for any hint.

    All the best -

    Tom

  • Thomas Beckert 193 posts 469 karma points
    Apr 23, 2020 @ 13:13
    Thomas Beckert
    100

    Found the solution:

     @{
                                ImageCropperValue stoererBild = Model.Value<ImageCropperValue>("bild");
                                string stoererBildCropUrl = stoererBild.Src + stoererBild.GetCropUrl("StoererBild");                               
                            }
                            <img class="dichtImg" src="@stoererBildCropUrl" alt="Open Imagination">
    
Please Sign in or register to post replies

Write your reply to:

Draft