扭曲位图为梯形 [英] Warp Bitmap to be Trapezoid
问题描述
我不知道这是问这个问题的合适地方.告诉我我是否错.
我尝试绘制具有透视效果的位图.在这种情况下,我尝试将图像变形为梯形.
我使用了Graphics.DrawImage函数,因为它接受点数组作为参数.在4点数组中,将产生NotImplementException.
所以这意味着drawimage函数只能将位图绘制成平行四边形吗?
那我如何绘制梯形图像?
我试图通过计算坐标以使其适合梯形,将像素一一复制到目标位图.
它可以工作,但是速度很慢并且效果很丑.
任何帮助将不胜感激.
欢呼声
Hi,
I don't know if this is the right place to ask this question. Tell me if i am wrong.
I try to draw a bitmap with perspective effect. in this case, i try to warp the image to be Trapezoid shape.
I used the Graphics.DrawImage function because it accepts an array of points as parameters.
However, every time i passed in an 4 points array, a NotImplementException will be produced.
So it means the drawimage function can only draw bitmap into parallelogram right?
How can I draw an trapezoid image then?
I've tried to copy the pixel one by one to the destination bitmap with calculating the coordinates to fit into a trapezoid.
It works, but it's very slow and the effect is ugly.
Any helps will be appreciated.
cheers
推荐答案
感谢您的发帖!我建议在一个MS论坛中发布您的问题,
Thank you for your post! I would suggest posting your question in one of the MS Forums,
located here: http://forums.asp.net/150.aspx.
这篇关于扭曲位图为梯形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!