是否有任何方式来绘制使用4个点,而不是3(立体翘曲)的图像

问题描述 投票:2回答:4

绘制一个平行四边形是很好的支持与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点(很明显,以下是不支持的,但是这是被通缉):

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);
}
c# .net gdi+
4个回答
-1
投票

最近的我能找到的是this information,这是非常laggy。


1
投票

通常你会用一个3x3矩阵做到这一点,但Matrix类只允许你指定6个值,而不是9.您可能能够做到这一点的直接X.


0
投票

当3D工具将如何处理它想...试着画一个半的三角形,然后另一个三角形的另一半。所以,如果你有点A,B,C,&d;你会画(用裁剪平面)A,B,C,然后B,C,d,或类似的东西。


0
投票

我发现下面的文章在CodeProject上:Free Image Transformation By YLS

需要一些作品

也许你可以使用这个:)

© www.soinside.com 2019 - 2024. All rights reserved.