Solved

# new Stretch Method, Stretch a Trapezoid but not a Retangle.

Posted on 2010-04-03

i have been looking codes to Stretch a Trapezoid for a long time. Is there anyone can help me ?

i have a bitmap(ABmp), i draw a Trapezoid(Trapezoid_A) on it, the two bottom of the Trapezoid is always parallel Y_axis,

then i move the upside bottom to any position(the length of the upside bottom keeps,and it always parallel Y_axis ).

now there is a a new Trapezoid(Trapezoid_B) by old downside bottom and the new upside bottom(the area of Trapezoid_B may less /more than the area of Trapezoid_A ).

what i need is Stretch Trapezoid_A into Trapezoid_B.

the function may like this

NewStretch(ABmp:TBmp; //the source bitmap

ATrapezoid:Array of TPoint; //Old Trapezoid

BTrapezoid:Array of TPoint; //New Trapezoid

BBmp:TBmp //the Dest bitmap

)

by the way, the speed of the function is important, i have wrote one ,but it's too slow to use.

and you can use any component.

could you give me the code?

any comments would be much appricated

thank you in advance