Image Resizer
2sxc has an awesome Image Resizer built in.
It's really easy to use - just add url parameters to the image. So instead of img.jpg
add img.jpg?w=200
to resize it to 200px width.
Internally it uses the amazing ImageFlow which has the same URL setup as the previous ImageResizer.net.
How to Use
You can learn about the url parameters in the Image Resizer URL Parameters
But normally you won't use them directly, because it's better to use APIs which will set these parameters for you. Your best options are:
- The IImageService with
.Img(...)
or.Picture(...)
which will create the best possible HTML for you - The Link.Image(...) which will create the best possible URL for you
In most scenarios you will prefer the IImageService
.
In cases where you need exactly 1 url (like in background-url
CSS) you will probably use the Link.Image(...)
.
History
- Introduced in 2sxc 5.03
- Special Razor API to create links called Link.Image introduced in 12.04
- Introduced ImageFlow in v12 for Oqtane
- Switched to ImageFlow in 13.0 for both Dnn and Oqtane
- Introducing IImageService in 13.05 beta, to be released in 13.10
Shortlink: https://go.2sxc.org/resize