var CloudmersiveImageApiClient = require('cloudmersive-image-api-client');
var defaultClient = CloudmersiveImageApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';



var apiInstance = new CloudmersiveImageApiClient.ResizeApi();

var maxWidth = 56; // Number | Maximum width of the output image - final image will be as large as possible while less than or equial to this width

var maxHeight = 56; // Number | Maximum height of the output image - final image will be as large as possible while less than or equial to this height

var imageFile = Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer); // File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.resizePost(maxWidth, maxHeight, imageFile, callback);
from __future__ import print_function
import time
import cloudmersive_image_api_client
from cloudmersive_image_api_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: Apikey
configuration = cloudmersive_image_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'



# create an instance of the API class
api_instance = cloudmersive_image_api_client.ResizeApi(cloudmersive_image_api_client.ApiClient(configuration))
max_width = 56 # int | Maximum width of the output image - final image will be as large as possible while less than or equial to this width
max_height = 56 # int | Maximum height of the output image - final image will be as large as possible while less than or equial to this height
image_file = '/path/to/file' # file | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

try:
    # Resize an image with parameters
    api_response = api_instance.resize_post(max_width, max_height, image_file)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResizeApi->resize_post: %s\n" % e)
using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.ImageRecognition.Api;
using Cloudmersive.APIClient.NET.ImageRecognition.Client;
using Cloudmersive.APIClient.NET.ImageRecognition.Model;

namespace Example
{
    public class ResizePostExample
    {
        public void main()
        {
            // Configure API key authorization: Apikey
            Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
            
            

            var apiInstance = new ResizeApi();
            var maxWidth = 56;  // int? | Maximum width of the output image - final image will be as large as possible while less than or equial to this width
            var maxHeight = 56;  // int? | Maximum height of the output image - final image will be as large as possible while less than or equial to this height
            var imageFile = new System.IO.FileStream("C:\\temp\\inputfile", System.IO.FileMode.Open); // System.IO.Stream | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

            try
            {
                // Resize an image with parameters
                byte[] result = apiInstance.ResizePost(maxWidth, maxHeight, imageFile);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ResizeApi.ResizePost: " + e.Message );
            }
        }
    }
}
// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.ResizeApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.setApiKeyPrefix("Token");

ResizeApi apiInstance = new ResizeApi();
Integer maxWidth = 56; // Integer | Maximum width of the output image - final image will be as large as possible while less than or equial to this width
Integer maxHeight = 56; // Integer | Maximum height of the output image - final image will be as large as possible while less than or equial to this height
File imageFile = new File("/path/to/file"); // File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.
try {
    byte[] result = apiInstance.resizePost(maxWidth, maxHeight, imageFile);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ResizeApi#resizePost");
    e.printStackTrace();
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');



$apiInstance = new Swagger\Client\Api\ResizeApi(
    
    
    new GuzzleHttp\Client(),
    $config
);
$max_width = 56; // int | Maximum width of the output image - final image will be as large as possible while less than or equial to this width
$max_height = 56; // int | Maximum height of the output image - final image will be as large as possible while less than or equial to this height
$image_file = "/path/to/file"; // \SplFileObject | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

try {
    $result = $apiInstance->resizePost($max_width, $max_height, $image_file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResizeApi->resizePost: ', $e->getMessage(), PHP_EOL;
}
?>
CMDefaultConfiguration *apiConfig = [CMDefaultConfiguration sharedConfig];

// Configure API key authorization: (authentication scheme: Apikey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Apikey"];




NSNumber* maxWidth = @56; // Maximum width of the output image - final image will be as large as possible while less than or equial to this width
NSNumber* maxHeight = @56; // Maximum height of the output image - final image will be as large as possible while less than or equial to this height
NSURL* imageFile = [NSURL fileURLWithPath:@"/path/to/file"]; // Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

CMResizeApi*apiInstance = [[CMResizeApi alloc] init];

// Resize an image with parameters
[apiInstance resizePostWithMaxWidth:maxWidth
              maxHeight:maxHeight
              imageFile:imageFile
          completionHandler: ^(NSData* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling CMResizeApi->resizePost: %@", error);
                        }
                    }];
# load the gem
require 'cloudmersive-image-recognition-api-client'
# setup authorization
CloudmersiveImageRecognitionApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveImageRecognitionApiClient::ResizeApi.new

max_width = 56 # Integer | Maximum width of the output image - final image will be as large as possible while less than or equial to this width

max_height = 56 # Integer | Maximum height of the output image - final image will be as large as possible while less than or equial to this height

image_file = File.new("/path/to/file") # File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.


begin
  #Resize an image with parameters
  result = api_instance.resize_post(max_width, max_height, image_file)
  p result
rescue CloudmersiveImageRecognitionApiClient::ApiError => e
  puts "Exception when calling ResizeApi->resize_post: #{e}"
end