how to develop a crop selection control like photoshop's in c# 4.0 in widows form application. I have a windows form application in c# 4.0 that can crop images. At first you have to draw a rectangle using mouse to select the cropped region [CODE]private Point _pt; private Point _pt2; private void picBoxImageProcessing_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { int ix = (int)(e.X / _zoom); int iy = (int)(e.Y / _zoom); //reset _pt2 _pt2 = new Point(0, 0); _pt = new Point(ix, iy); // pictureBox1.Invalidate(); picBoxImageProcessing.Invalidate(); } } private void picBoxImageProcessing_MouseUp(object sender, MouseEventArgs e) { if (e.Button …

Member Avatar
Member Avatar
+0 forum 1

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: [CODE] Image img = Image.FromFile("filepath"); picBoxImageProcessing.Image = img;[/CODE] zoom in: [CODE] zoomFactor += 1; picBoxImageProcessing.Size = new Size((img.Width * zoomFactor), (img.Height * zoomFactor)); picBoxImageProcessing.SizeMode = PictureBoxSizeMode.StretchImage;[/CODE] cropping: Draw a rectangular shape on the image and then crop. [CODE]Crop(Image img, Rectangle r) { // }[/CODE] In this way when i zoom in first …

Member Avatar
+0 forum 0

how can i crop an image based on the size of my picturebox? my picturebox's size mode is normal, i want to have for example, a 100 x 100 image using a 100 x 100 picture box, also i can drag the the image inside the picturebox so that i can have a focal point, a center of the image that i want to crop on. thanks guys! itll be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 3

The End.