Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.36/5 (3 votes)
See more:
how can we crop a image in web page.
Posted
Updated 30-Jun-18 5:58am
Comments
parmar_punit 22-Jun-11 1:33am    
Please see my solution no.4 to get the nearest answer.

The way I would do it is to use jQuery and the jCrop[^] plugin. This plugin attaches to images in your web page to automatically provide this capability - more importantly, it runs cross browser and it's extensible.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 21-Jun-11 8:14am    
Yeah, jQuery! 5+
[no name] 21-Jun-11 9:06am    
A nice little tool.

Will it be used in Windows 8 for the Paint app :)
Pete O'Hanlon 21-Jun-11 10:13am    
rotfl
Firo Atrum Ventus 22-Jun-11 1:42am    
ROFL, I wish I could give you 5 for that comment.
Monjurul Habib 21-Jun-11 17:53pm    
nice answer, 5+, please look at my answer.
It depends what you mean by crop. If you really mean resize, then just set the size of the img element. If you actually mean to extract a portion of the image, then you can do it before the image is rendered. Something like this;

Bitmap bmp = new Bitmap(existingImage);
Bitmap bmpCrop = bmpImage.Clone(croppedArea, bmp.PixelFormat);
return (Image)(bmpCrop); 
 
Share this answer
 
Comments
Manfred Rudolf Bihy 21-Jun-11 8:14am    
Good answer! 5+
Monjurul Habib 21-Jun-11 17:54pm    
nice answer, 5+, please look at my answer.
[no name] 21-Jun-11 18:06pm    
The self-promotion was unnecessary
Monjurul Habib 21-Jun-11 18:17pm    
i just want to know the solution was ok or not..as you people are more experienced, your feedback's are really helpful for me.Sincerely that was not self-promotion.anyway you may be already down voted me.
Monjurul Habib 21-Jun-11 18:27pm    
waiting for your response . :)
Try this[^] link it will definitely help you.
 
Share this answer
 
v2
You can use the JavaScript Image Cropper UI to solve the problem. Following is the example for ASP.net and C#.
ASP.NET Image / Photo Cropper in C#
 
Share this answer
 
Comments
Monjurul Habib 21-Jun-11 18:19pm    
Can any one please explain why down voted ??
Albert Holguin 21-Jun-11 18:39pm    
sometimes people do that... hard to explain why anyone does anything...
Monjurul Habib 22-Jun-11 3:21am    
but this is wired.
Albert Holguin 22-Jun-11 9:58am    
wired?
Monjurul Habib 22-Jun-11 11:05am    
i mean , down vote without any comment is wired...
Hope this[^] might help you.
 
Share this answer
 

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