Copied to clipboard

Flag this post as spam?

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


  • mikkel 142 posts 364 karma points
    1 week ago
    mikkel
    0

    useCropDimensions:true give mee 100x100 pixel size image

    I do not understand, is it not intended that when I use useCropDimensions: true, then it should use the crop I have now requested it? I get my pictures in 100X100 pixels large and no matter which crop I use then it is 100x100 pixels I have crops of 100x100 and 150x 150 and 250x250 pixels and I would like to choose the rest I want. why can't I

    my code:

    @foreach (var item in portfolio)
                    {
                        //henter thumbnail billede fra portfolio
                        var thumbnail = (IPublishedContent)item.Value("thumbnailPortefolie");                   
    
                        <div class="col-sm-6 col-lg-3 artwork">
                            <div class="portfolio-box rounded my-3">
                                <div class="portfolio-img rounded">
    
                                    <img class="img-fluid d-block" src="@thumbnail.GetCropUrl(useCropDimensions:true);" />
    
                                    <div class="portfolio-overlay">
                                        <a class="popup-ajax stretched-link" href="@item.Value("linkTilHjemmesidenPortefolie")"></a>
                                        <div class="portfolio-overlay-details">
                                            <p class="text-white text-6"><i class="fas fa-plus"></i></p>
                                            <h5 class="text-white font-weight-400">@item.Name</h5>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    }
    
  • Craig100 1060 posts 2322 karma points c-trib
    1 week ago
    Craig100
    0

    Hi Mikkel,

    You haven't told the code which crop to use. If you have a crop already set up, let's call it "myCrop" then your code should be:-

    <img class="img-fluid d-block" src="@thumbnail.GetCropUrl("myCrop");" />
    

    HTH.

    / Craig

Please Sign in or register to post replies

Write your reply to:

Draft