TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
learner learner
NA
29
155.4k
How to crop an image that is zoomed(zoomed in/out)
Feb 15 2012 11:54 PM
How to crop an image that is zoomed(zoomed in/out). Cropping works fine when the image is normal, that is not zoomed. I have used a panel whose AutoScroll property is true and a picturebox inside the panel whose sizemode property is AutoSize and BackgroundImageLayout is Tile.
Load image:
Image img = Image.FromFile("filepath");
picBoxImageProcessing.Image = img;
zoom in:
zoomFactor += 1;
picBoxImageProcessing.Size = new Size((img.Width * zoomFactor), (img.Height * zoomFactor));
picBoxImageProcessing.SizeMode = PictureBoxSizeMode.StretchImage;
cropping:
Draw a rectangular shape on the image and then crop.
Crop(Image img, Rectangle r)
{
//
}
In this way when i zoom in first and then select a specific region drawing a rectangle on the zoomed image and then crop then another region is cropped rather than i have selected.
I have got many application for image processing but I couldn't solve my problem.
thanks in advance.
Reply
Answers (
1
)
How to give link in html file records using asp.net
Unit testing using moq - verify does'n work