如何在固定的div中以相同的大小分割图像 [英] How to split image in equal size in a fixed div

查看:121
本文介绍了如何在固定的div中以相同的大小分割图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网络应用程序中,我想添加一个功能,其中图像将根据图像数量自动修复。我将解释完整的场景。

假设有一个宽度为600px的div。现在我已经在应用程序中上传了一张图片,然后一张图片将覆盖600px。虽然我上传了另一张照片,容器尺寸将分为300x300。如果有10张照片,每张照片需要60px。喜欢这个。



这个功能我想在我的应用程序中添加,我用谷歌搜索但注意到有趣的发现到现在。我想用JQuery做这个。



有谁能指导我解决这个问题吗?

提前谢谢。

Here in my web application i want to add one feature where image will fix automatically as per number of images. I'll explain the complete scenario.
Suppose there is a div which width is say 600px. Now i've uploaded one picture in the application and then that one picture will cover the 600px are. While i've uploaded another picture that container size will divide into 300x300. if 10 pictures are there each will take 60px. Like this.

This feature i want to add inside my application, i've googled but noting interesting found till now. I would like to do this using JQuery.

Can anyone please guide me to solve this?
Thanks in advance.

推荐答案

您可以使用 System.Drawing 在服务器端轻松完成。您只需从保存的文件中打开上传的文件,或直接从HTTP请求的流中打开并拆分它。根据定义源位图片段位置和大小的矩形值,可以通过将原始位图顺序克隆到所需片段来完成非破坏性分割:

http://msdn.microsoft.com/en-us/library/ms141944%28v= vs.110%29.aspx [ ^ ]。



-SA
You can do it easily on the server side using System.Drawing. You just open the uploaded file from the saved file or directly from HTTP request's stream and split it. Non-destructive splitting can be done by sequential cloning of the original bitmap to the desired fragments, according to the value of the rectangle defining position and size of the fragment of the source bitmap:
http://msdn.microsoft.com/en-us/library/ms141944%28v=vs.110%29.aspx[^].

—SA


这篇关于如何在固定的div中以相同的大小分割图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆