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
Is it possible to resize an image using GetCropUrl() only setting ie. max width?
Yes it is, could you post your current code where you wish to do this so I can give you the correct snippet?
<img src="@media.GetCropUrl("bigImage")" alt="" />
Can you show me how you set @media?
var media = Umbraco.Media(page.GetValue<int>("image"));
Ok then, this should do it:
At the top add:
@using Umbraco.Web.Models
Then
@{ var media = Umbraco.TypedMedia(page.GetValue<int>("image")); } <img src="@media.GetCropUrl(propertyAlias:"bigImage", imageCropMode:ImageCropMode.Pad, width:300)" alt="" />
Thanks
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Resize image
Is it possible to resize an image using GetCropUrl() only setting ie. max width?
Yes it is, could you post your current code where you wish to do this so I can give you the correct snippet?
<img src="@media.GetCropUrl("bigImage")" alt="" />
Can you show me how you set @media?
var media = Umbraco.Media(page.GetValue<int>("image"));
Ok then, this should do it:
At the top add:
Then
Thanks
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.