有没有办法绘制图像以使用4点而不是3点(透视扭曲) [英] Is there any way to draw an image to use 4 points rather than 3 (perspective warp)

查看:51
本文介绍了有没有办法绘制图像以使用4点而不是3点(透视扭曲)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Graphics.DrawImage很好地支持绘制平行四边形:

Drawing a parallelgram is nicely supported with Graphics.DrawImage:

Bitmap destImage = new Bitmap(srcImage.Width, srcImage.Height);
using (Graphics gr = new Graphics.FromImage(destImage))
{
    Point[] destPts = new Point[] { new PointF(x1, y1), 
        new PointF(x2, y2), new PointF(x4, y4)};
    gr.DrawImage(srcImage, destPts);

您如何做4分(显然不支持以下功能,但这是需要的):

How, do you do 4 points (obviously the following is not supported, but this is what is wanted):

Bitmap destImage = new Bitmap(srcImage.Width, srcImage.Height);
using (Graphics gr = new Graphics.FromImage(destImage))
{
    Point[] destPts = new Point[] { new PointF(x1, y1), new PointF(x2, y2),
        new PointF(x3, y3), new PointF(x4, y4)};
    gr.DrawImage(srcImage, destPts);
}

推荐答案

我能找到的最接近的是这些信息,这是非常漫长的.

Closest I can find is this information, which is extremely laggy.

这篇关于有没有办法绘制图像以使用4点而不是3点(透视扭曲)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆