Android Question bitmapcreator size issue

Scantech

Well-Known Member
Licensed User
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?
 

Scantech

Well-Known Member
Licensed User
When you say the code is inefficient. Are you talking about the whole codes or just referring to xWidth and xHeight. This example was from your drawRoundedRect in my other thread.
 
Last edited:
Top