how to cut a segment from an image?
-
using VC++, how to cut a rectangle segment picture from an bmp format image? and the cutting rectangle can has diffrent angle. my mean is that the cutted image is certainly rectangle, and the cutting segment is also rectangle, but the tow rectangles are not parallel, there is a rotated angle between them. thanks
-
using VC++, how to cut a rectangle segment picture from an bmp format image? and the cutting rectangle can has diffrent angle. my mean is that the cutted image is certainly rectangle, and the cutting segment is also rectangle, but the tow rectangles are not parallel, there is a rotated angle between them. thanks
-
using VC++, how to cut a rectangle segment picture from an bmp format image? and the cutting rectangle can has diffrent angle. my mean is that the cutted image is certainly rectangle, and the cutting segment is also rectangle, but the tow rectangles are not parallel, there is a rotated angle between them. thanks
There are two things I think you could be wanting to do here. I assume you don't want to draw a rotated black rectangle over the image, but want to get a rotated bit of the image This is quite drawn out to explain if you don't have much experience with graphics already... What you want to do is take the rectangle you want to cut and work out coordinates for the pixels, translate and rotate them (rotation matrix - google) and interpolate (bilinear interpolation - google it) between the neighbouring pixels in the original image to find the new pixel values. I would give a full explanation, but if you are a graphics programmer you should already be familiar with these ideas. Hope this helps.
-
There are two things I think you could be wanting to do here. I assume you don't want to draw a rotated black rectangle over the image, but want to get a rotated bit of the image This is quite drawn out to explain if you don't have much experience with graphics already... What you want to do is take the rectangle you want to cut and work out coordinates for the pixels, translate and rotate them (rotation matrix - google) and interpolate (bilinear interpolation - google it) between the neighbouring pixels in the original image to find the new pixel values. I would give a full explanation, but if you are a graphics programmer you should already be familiar with these ideas. Hope this helps.
thank you Jheriko++: maybe i didn't describe my question clearly. assume i have a big image which is rectange, i want to cut a segment image from the big image, the segment image is also rectance, but the borders of the segment rectange are not parallel with the big image borders. but from your explain, i think you first cut a rectange image from the big image, and then rotaed it. wish you understand my opinion.:)