I created a web service and had imagefield from the sitecore6.6. Now i am want to change the width and height of image dynamically so that i have big image on the fly. There are almost 1000 pictures which require size change . Any help...
You can use several query string parameters in the url of the image to let Sitecore modify the image. The image has to be a Sitecore Media item.
Here is a list of the supported query string parameters:
In your case you can use for example the ?as=1&w=600 to get the image resized to 600px width.
You can also do this programmatically to set the MediaUrlOptions when creating the mediaUrl:
var mediaOptions = new MediaUrlOptions {AllowStretch = true, Width = 600};
var mediaUrl = MediaManager.GetMediaUrl(mediaItem, mediaOptions);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With