I'm trying to use the
@Display.ResizeMediaUrl()
In Orchard 1.7.2, However I need to get the value of the resized Media url in a controller so I can return it to a javascript function.
I can see in there is a
[shape]
public void ResizeMediaUrl
Shape in MediaShapes.cs (Orchard.MediaProcessing.Shapes) but I'm not sure how to use this. from a controller.
You'll need a reference to
IImageProfileManager
in your controller which you set up in the ConstructorWithin the Controller Action you can call
GetImageProfileUrl
which will resize the image for you.I've hacked this out of the ResizeMediaUrl shape and hardcoded the Mode, Alignment and Colour settings.
e.g.