Flash上​​传图片调整客户端大小

时间:2022-08-28 08:00:08

Does anyone got an ideia on how to get client side image resize using flash.

有没有人有一个关于如何使用闪存来调整客户端图像大小的想法。

Example: Client chooses an image with 1200x800 and before it uploads it flash will turn it into half of it or something.

示例:客户端选择1200x800的图像,在上传之前,flash会将其转换为其中的一半。

Any thoughts?

7 个解决方案

#1


Plupload is Opensource, has good documentation and supports multiple platforms, including Gears and HTML5!

Plupload是Opensource,具有良好的文档并支持多种平台,包括Gears和HTML5!

http://www.plupload.com/index.php
http://www.plupload.com/example_all_runtimes.php

Ah, yes, it supports resizing images BEFORE uploading. The closest option to aurigma, but for free :)

啊,是的,它支持在上传之前调整图像大小。最接近aurigma的选项,但免费:)

#2


take a look at the script i wrote : image resizing at client side

看一下我写的脚本:在客户端调整图像大小

#3


http://www.shift8creative.com/projects/agile-uploader/index.html

I just finished this little project - free to use. It won't really allow the end user to select the size, but you can pass a max width and max height constraint. Maybe you can make multiple pages/embeds with different options.

我刚完成这个小项目 - 免费使用。它不会真正允许最终用户选择大小,但您可以传递最大宽度和最大高度约束。也许你可以使用不同的选项制作多个页面/嵌入。

#4


Silverlight, ActiveX and Java can do this completely client-side. If you have to use Flash you are going to need to use Flash 10 which isn't prevalent quite yet. Here is an example on uploading an image to Flash then resizing it on the client from Flash Cafe.

Silverlight,ActiveX和Java可以完全在客户端执行此操作。如果必须使用Flash,则需要使用目前尚不普及的Flash 10。以下是将图像上传到Flash,然后从Flash Cafe在客户端上调整大小的示例。

Other options in Flash 8 or 9 would involve a server-side resizing script, defeating the purpose in most scenarios.

Flash 8或9中的其他选项将涉及服务器端调整大小脚本,在大多数情况下都会失败。

#5


You need create a transformation matrix, then draw the original bitmap into a new one using it. Here's the idea in something i am just typing in and have not tested:

您需要创建一个变换矩阵,然后使用它将原始位图绘制成一个新的位图。这是我刚刚输入的内容并且没有测试过的想法:

function resize(obm:BitmapData, scale:Number): BitmapData {
   var resizeMatrix:Matrix = new Matrix();
   resizeMatrix.scale(scale, scale);

   var rbm:BitmapData = new BitmapData(obm.width * scale, obm.height * scale);
   rbm.draw(obm, resizeMatrix);

   return rbm;
}

I make no claims about the quality of the result, however. I think I remember trying this in the past, not liking the result, and punting...

但是,我没有对结果的质量提出任何要求。我想我记得在过去尝试这个,不喜欢结果,并且...

#6


I'm using flash uploader from http://www.resize-before-upload.com, works just fine :)

我正在使用来自http://www.resize-before-upload.com的flash uploader,工作得很好:)

#7


The latest version of SwfUpload does client-side image resizing (using Flash). A pretty useful tool, although extras like displaying upload progress can get a little fiddly.

最新版本的SwfUpload可以调整客户端图像大小(使用Flash)。一个非常有用的工具,虽然显示上传进度等额外内容可能会有点繁琐。

http://code.google.com/p/swfupload/

#1


Plupload is Opensource, has good documentation and supports multiple platforms, including Gears and HTML5!

Plupload是Opensource,具有良好的文档并支持多种平台,包括Gears和HTML5!

http://www.plupload.com/index.php
http://www.plupload.com/example_all_runtimes.php

Ah, yes, it supports resizing images BEFORE uploading. The closest option to aurigma, but for free :)

啊,是的,它支持在上传之前调整图像大小。最接近aurigma的选项,但免费:)

#2


take a look at the script i wrote : image resizing at client side

看一下我写的脚本:在客户端调整图像大小

#3


http://www.shift8creative.com/projects/agile-uploader/index.html

I just finished this little project - free to use. It won't really allow the end user to select the size, but you can pass a max width and max height constraint. Maybe you can make multiple pages/embeds with different options.

我刚完成这个小项目 - 免费使用。它不会真正允许最终用户选择大小,但您可以传递最大宽度和最大高度约束。也许你可以使用不同的选项制作多个页面/嵌入。

#4


Silverlight, ActiveX and Java can do this completely client-side. If you have to use Flash you are going to need to use Flash 10 which isn't prevalent quite yet. Here is an example on uploading an image to Flash then resizing it on the client from Flash Cafe.

Silverlight,ActiveX和Java可以完全在客户端执行此操作。如果必须使用Flash,则需要使用目前尚不普及的Flash 10。以下是将图像上传到Flash,然后从Flash Cafe在客户端上调整大小的示例。

Other options in Flash 8 or 9 would involve a server-side resizing script, defeating the purpose in most scenarios.

Flash 8或9中的其他选项将涉及服务器端调整大小脚本,在大多数情况下都会失败。

#5


You need create a transformation matrix, then draw the original bitmap into a new one using it. Here's the idea in something i am just typing in and have not tested:

您需要创建一个变换矩阵,然后使用它将原始位图绘制成一个新的位图。这是我刚刚输入的内容并且没有测试过的想法:

function resize(obm:BitmapData, scale:Number): BitmapData {
   var resizeMatrix:Matrix = new Matrix();
   resizeMatrix.scale(scale, scale);

   var rbm:BitmapData = new BitmapData(obm.width * scale, obm.height * scale);
   rbm.draw(obm, resizeMatrix);

   return rbm;
}

I make no claims about the quality of the result, however. I think I remember trying this in the past, not liking the result, and punting...

但是,我没有对结果的质量提出任何要求。我想我记得在过去尝试这个,不喜欢结果,并且...

#6


I'm using flash uploader from http://www.resize-before-upload.com, works just fine :)

我正在使用来自http://www.resize-before-upload.com的flash uploader,工作得很好:)

#7


The latest version of SwfUpload does client-side image resizing (using Flash). A pretty useful tool, although extras like displaying upload progress can get a little fiddly.

最新版本的SwfUpload可以调整客户端图像大小(使用Flash)。一个非常有用的工具,虽然显示上传进度等额外内容可能会有点繁琐。

http://code.google.com/p/swfupload/