我有以下上传代码,在用户从他们的相册中选择图像后调用:
public void Picked(object sender, UIImagePickerMediaPickedEventArgs e)
{
picker.DismissViewController (false, null);
image.Image = e.Info [UIImagePickerController.OriginalImage] as UIImage;
//get a stream of the image data
imageData = image.Image.AsPNG().AsStream();
filename = filenameBox.Text;
spinner.StartAnimating ();
Thread t = new Thread (UploadImage);
t.Start ();
}
public void UploadImage()
{
//upload to s3
Amazon.S3.AmazonS3Client s3 = new AmazonS3Client ("My access key", "my secret key");
// Create a PutObject request
PutObjectRequest request = new PutObjectRequest {
BucketName = "my bucket name",
Key = filename
};
//put the image data into the request
request.InputStream = imageData;
// Put image
PutObjectResponse response = s3.PutObject(request);
InvokeOnMainThread (StopSpinning);
}
一切正常,但 iPhone 相机图像尺寸较大,上传速度非常慢。我正在寻找一种在将图像上传到s3
.
我读过其他讨论单scale
点触控功能的问题?这是诀窍吗?我该如何使用它?
我不想裁剪图像,只是压缩和缩小尺寸。如何做到这一点?
我正在寻找一个monotouch
特别的例子而不是objective c