Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
Krunal Rohit 21-Feb-14 7:50am    
I'm not sure but still look at here,
http://stackoverflow.com/questions/11957591/dynamically-split-3-divs

-KR
Sergey Alexandrovich Kryukov 21-Feb-14 12:49pm    
OP's question is completely different. I'll answer.
—SA

1 solution

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
 
Share this answer
 
Comments
sahabiswarup 21-Feb-14 23:58pm    
Thanks SA for this above information; but this example is for "The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler." and i want to implement this in web. So can you please provide some information about that?
Sergey Alexandrovich Kryukov 22-Feb-14 0:24am    
Ah, you did not get it!

There is no single line which really need using Forms. Just forget this example, look at System.Drawing part only. This part of the library, System.Drawing, is routinely used in ASP.NET, for image manipulations, usually on bitmaps.

Are you getting it now?

—SA
sahabiswarup 22-Feb-14 0:36am    
Ok, let me try once. Thanks anyway.
Sergey Alexandrovich Kryukov 22-Feb-14 0:52am    
Please don't forget to accept the answer formally (green "Accept" button).
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900