unity 调整画布大小_使用画布,拖放和File API调整图像大小

unity 调整画布大小

It's a massive honor to have Tom "Trenkavision" Trenka write a guest post for this blog. Tom was one of the original contributors of the Dojo Toolkit and my mentor at SitePen. I've seen his genius first hand and he's always the first one to foresee issues with a potential solution. He also thinks outside the box, coming up with unconventional but reliable solutions to edge case problems. This is a perfect example.

让Tom“ Trenkavision” Trenka为这个博客写客座帖子,这是非常荣幸。 Tom是Dojo Toolkit的原始作者之一,也是我在SitePen的导师。 我亲眼目睹了他的天才,他始终是第一个预见到具有潜在解决方案问题的人。 他还开创了思路,提出了解决边缘案例问题的非常规但可靠的解决方案。 这是一个完美的例子。

Recently I was asked to create a user interface that allows someone to upload an image to a server (among other things) so that it could be used in the various web sites my company provides to its clients. Normally this would be an easy task—create a form with a File input, let someone navigate to the image in question on their computer, and upload it using multipart/form-data as the enctype in the form tag. Simple enough, right? In fact, there's a simple enough example right on this site.

最近,有人要求我创建一个用户界面,该界面允许某人将图像上传到服务器(除其他外),以​​便可以在公司向其客户提供的各种网站中使用该图像。 通常,这是一项容易的任务-使用文件输入创建表单,让某人导航到计算机上有问题的图像,然后使用multipart/form-data作为form标签中的enctype上载该图像。 很简单,对不对? 实际上, 此站点上有一个足够简单的示例。

But what if you had pre-prepare that image in some way? In other words, what if you had to resize that image first? What if you needed that image to be a particular file type, like a PNG or a JPG? Canvas to the rescue!

但是,如果您已经以某种方式预先准备了该图像怎么办? 换句话说,如果必须先调整该图像的大小怎么办? 如果您需要将该图像设为特定的文件类型(如PNG或JPG),该怎么办? 帆布救援!

什么是画布? (What is the Canvas?)

The Canvas is a DOM element, added in HTML5, that allows a user to draw graphics directly in a page, usually through Java

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值