Transform object

'a class to draw a 4 point transformed image.
'the image is perspective warped between the 4 control points.
'this can be used as a spiffy sprite class.

'it's not required, but this class can store imagery as well.
'be sure to save an undo first if using the methods that draw from the main image.

'Destination image buffers.  Only use this if you do not want to render to the main image.
Sub Transform_FromBrush_ToBuffs(ByVal w As Long, h As Long, rbuf() As Byte, gbuf() As Byte, bbuf() As Byte, Optional ByVal index As Long)

'this is needed for rotation and scaling...  you don't have to specify this if you only need to specify control points without scaling or rotating them.
'this should be between 0 and 1
Sub
Center(ByVal x As Single, ByVal y As Single)

'if you call this multiple times, you'll have to re-set the points each time.
Sub
RotatePoints(ByVal angle As Single)

'if you call this multiple times, you'll have to re-set the points each time.
Sub
ScalePoints(ByVal Size As Single)

Sub
point1(ByVal x As Single, y As Single)

Sub
point2(ByVal x As Single, y As Single)

Sub
point3(ByVal x As Single, y As Single)

Sub
point4(ByVal x As Single, y As Single)

Sub
fillcolor(ByVal r, ByVal g, ByVal b)

Sub
Transform_fromCanvas()

Sub
Transform_FromBrush(Optional ByVal UseAlpha As Boolean = True, Optional ByVal UseAnimbrush As Boolean = False, Optional ByVal index As Long = 0)

Sub
SetImage(ByVal tw As Long, ByVal th As Long, rbuf_, gbuf_, bbuf_, abuf_)

Sub
Transform()

Sub
Transform_FromBrush_ToBuffs_tinted(ByVal r As Single, ByVal g As Single, ByVal b As Single, ByVal w As Long, h As Long, rbuf() As Byte, gbuf() As Byte, bbuf() As Byte, Optional ByVal index As Long)