code_junkie

Is there any way to draw an image to use 4 points rather than 3 (perspective warp)

Nov 10th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Bitmap destImage = new Bitmap(srcImage.Width, srcImage.Height);
  2. using (Graphics gr = new Graphics.FromImage(destImage))
  3. {
  4. Point[] destPts = new Point[] { new PointF(x1, y1),
  5. new PointF(x2, y2), new PointF(x4, y4)};
  6. gr.DrawImage(srcImage, destPts);
  7.  
  8. Bitmap destImage = new Bitmap(srcImage.Width, srcImage.Height);
  9. using (Graphics gr = new Graphics.FromImage(destImage))
  10. {
  11. Point[] destPts = new Point[] { new PointF(x1, y1), new PointF(x2, y2),
  12. new PointF(x3, y3), new PointF(x4, y4)};
  13. gr.DrawImage(srcImage, destPts);
  14. }
Add Comment
Please, Sign In to add comment