B4X:
Sub DrawRadial(Width As Float, Height As Float, Clrs() As Int, Orientation As String) As B4XBitmap
Dim Gradient As BitmapCreator
Gradient.Initialize(10, Height)
Gradient.FillGradient(Clrs, Gradient.TargetRect, Orientation)
Dim Brush As BCBrush = Gradient.CreateBrushFromBitmapCreator(Gradient)
Dim bc As BitmapCreator
bc.Initialize(Width, Height)
Dim xWidth As Float = Width/2
Dim xHeight As Float = Height/2
bc.DrawCircle2(xWidth, xHeight, xWidth, Brush, True, 0)
Return bc.Bitmap
End Sub
my dimensions(height and width) are always the same.
If the width and height are odd numbers it will not draw correctly at the right side of the circle. For eg. xHeight = 117.5 it will not draw correctly. Any fraction numbers available it will not draw correctly. Any idea why this happens?