Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to play with ImageCropMode in method GetCropUrl() so I added:
to ("Max" is just an example mode):
image.GetCropUrl(100, 100, imageCropMode:ImageCropMode.Max)
I get this error:
CS0103: The name 'ImageCropMode' does not exist in the current context
What do I need to do?
The problem I am trying solve is: After going from calling image url directly (/media/xxxx/image.jpg?width=100&height=100) to now using GetCropUrl() a lot of images have some black padding arround them. This only goes away if I go to every single image in the backend, moves the focalpoint and saves.
See example photo below:
It seems like you're missing a reference, put this at the top of the cshtml:
Then you should be able to get the crop URL like this:
var test = yourImage.PreviewImage.GetCropUrl(30, 30, imageCropMode: ImageCropMode.Max);
My bad!!!! 🙄
I wrote that I had added
... but checking my code again I see that I actually forgot...
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted