Help with getting data from resized image.
- by nick
I'm using an ASP.NET file upload control and then resizing an image and storing the new image in a new Bitmap. Here is the code I have so far:
protected void ResizeImage()
{
Bitmap originalBMP = new Bitmap(FileUpload1.FileContent);
//Calculate new image dimensions
int origWidth = originalBMP.Width;
int origHeight = originalBMP.Height;
int sngRatio = origWidth / origHeight;
int newWidth = 100;
int newHeight = newWidth / sngRatio;
Bitmap newBMP = new Bitmap(originalBMP, newWidth, newHeight);
}
I'm uploading directly to Amazon S3 and I need to pass some data to its upload method. How do I get the following information from my new bitmap that I have been using with the fileupload?:
FileUpload1.FileBytes
FileUpload1.FileBytes.Length
Do I need to save my new bitmap to a stream so I can get an array of bytes?