From the course: Building a Web Application on Microsoft Azure

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Implementing the resize code and the output binding

Implementing the resize code and the output binding - Azure Tutorial

From the course: Building a Web Application on Microsoft Azure

Implementing the resize code and the output binding

- [Instructor] In this video we're going to implement the code for creating the thumbnails. For this, I'm going to use the ImageSharp NuGet package. So let's right click on the project and then Manage NuGet Packages. And the name is SixLabors.ImageSharp. So let's install this and we're ready to go. So let's go back here and let's do the following. Underneath run let's create a new method named, say, Resize where I want to receive the input stream. In other words, the stream that represents the photo that has been uploaded. And I also want to receive the output stream, so this stream will be used for writing purposes. So I'm going to write the resized image in this stream. Okay, so let's do the following. I'm going to use the image class that comes from the SixLabors.ImageSharp namespace and let's execute load, since I want to load this input stream and I want to save this in a variable, I think it's better to use using…

Contents