Hello,
Ive got a problem with Drawing multiple Colors on a Canvas. The different Colors are stored in an array.
Heres my code:
Items is an Array with a predefined Length of 5.
The result of this code are BLACK bars on the canvas. MAybe its a strange behaviour between B4i Color and UIColor?
I hope somebody can help me...
Edit: Forgot to mention that its also not working if i set Color explicit to Colors.Green for example when drawing the rect
Ive got a problem with Drawing multiple Colors on a Canvas. The different Colors are stored in an array.
Heres my code:
B4X:
Dim color() As Int = Array As Int(Colors.RGB(56,142,60),Colors.RGB(104,159,56),Colors.RGB(139,195,74),Colors.RGB(251,192,45),Colors.RGB(230,74,25))
For i =0 To Items.Length -1
If Items(i) > 0 Then
Dim rect As Rect
rect.Initialize(5*px + sw,top + height * i,sw + 5*px + width * Items(i),top + height * i + height)
cv_total.DrawRect(rect,color(i),True,0)
Else
Dim rect As Rect
rect.Initialize(5*px + sw,top + height * i,5*px + sw + 5dip,top + height * i + height)
cv_total.DrawRect(rect,color(i),True,0)
End If
Next
Items is an Array with a predefined Length of 5.
The result of this code are BLACK bars on the canvas. MAybe its a strange behaviour between B4i Color and UIColor?
I hope somebody can help me...
Edit: Forgot to mention that its also not working if i set Color explicit to Colors.Green for example when drawing the rect