Change Size of the Image with C# REST API

This short tutorial guides on how to change size of the image with C# REST API. You will learn to develop an image resizer with C# RESTful Service using a .NET-based Cloud SDK. It will explain all the necessary steps, properties, and methods required to accomplish this task.

Prerequisite

Steps to Change Size of Pic Online with C# Low Code API

  1. Instantiate an object of the ImagingApi by defining the Client ID, secret and Cloud endpoint
  2. Define and upload the source image to the Cloud storage whose size is to be changed
  3. Define the resize parameters by setting output image width, height, and format
  4. Prepare and execute the resize image request ResizeImageRequest class and ResizeImage() method
  5. Save the resized image to the local disk by downloading the output file from the Cloud

These steps summarize how to decrease pic size with C# Low Code API. Instantiate the process by initializing the API client and base URL, defining the input image, uploading it to the Cloud storage, and defining the resize parameters. Finally, prepare and execute the resize image request using the ResizeImageRequest object and ResizeImage() method before saving the resized image on the local disk.

Code for Image Resizer with C# RESTful Service

This code has demonstrated the development of an image size converter with C# RESTful Service. The API response returns the resultant image bytes stream that you may save on a disk or communicate over the network if required. If the API call is successful, it returns 200 code and if not successful, it may return codes 400, 401, 404, 500, and 501.

This article has guided us in developing a photo size converter with C# REST Interface. To convert an SVG image to WMF, refer to the article on Convert SVG to WMF with NET REST API.

 English