Ravi Ram
Ravi Ram

Reputation: 24488

C# Aws-Lambda Image Resizing

I currently have a working C# AWS-Lambda Function working. It is triggered when any file is upload to my S3 bucket.

I am trying to resize images when they hit the S3 bucket. I don't know how to include/reference an image resizing tool.

Is there an AWS Built-in function I can use within my C# AWS-Lambda project in VS2017?

Upvotes: 2

Views: 1348

Answers (1)

sid8491
sid8491

Reputation: 6800

You can trigger the C# lambda function when the image is uploaded on S3 bucket. Just pass the image reference to lambda function and somethinge like below code can resize it.

public static Image resizeImage(Image imgToResize, Size size)
    {
       return (Image)(new Bitmap(imgToResize, size));
    }

    yourImage = resizeImage(yourImage, new Size(50,50));

Note: code is taken from this answer.

Upvotes: 1

Related Questions