Sub DrawTrapezoid(BG As Canvas, BMP As Bitmap ,SRC As Rect , X As Int, Y As Int, TopWidth As Int, BottomWidth As Int, Height As Int, Alpha As Int)
Dim BottomLeft As Int
ExDraw.save2(BG, LCAR.ExDraw.MATRIX_SAVE_FLAG)
If TopWidth=0 Then TopWidth=BottomWidth
If BottomWidth=0 Then BottomWidth=TopWidth
If BottomWidth> TopWidth Then X = X + (BottomWidth-TopWidth)/2
BottomLeft = X+ TopWidth/2 - BottomWidth/2
If SRC=Null Then SRC.Initialize(0,0, BMP.Width, BMP.Height)
mPaint.Initialize
mPaint.SetAlpha(Alpha)
mMatrix.setPolyToPoly( Array As Float(SRC.Left,SRC.Top, SRC.Right,SRC.Top, SRC.Right, SRC.Bottom, SRC.Left,SRC.Bottom), 0, Array As Float( X,Y, X+TopWidth,Y, BottomLeft+BottomWidth, Y+Height, BottomLeft, Y+Height ), 0,4)
ExDraw.drawBitmap4(BG, BMP, mMatrix, mPaint)
ExDraw.restore(BG) 'before Activity.Invalidate
End Sub