Private Sub line(BC As BitmapCreator, x1 As Int, y1 As Int, x2 As Int, y2 As Int, Color As Int)
Dim Dx,Dy,Diff As Int
Dim x,y As Float
Dx = x2 - x1
Dy = y2 - y1
Diff=Max(Abs(Dx),Abs(Dy))
For D=0 To Diff
x= x1 + Dx*D/Diff
y = y1 + Dy*D/Diff
If (x>=0 And x<BC.mWidth) And (y>=0 And y<BC.mHeight) Then BC.SetColor(x,y,Color)
Next
End Sub
If you need to have one often 1dip each point you have to "enlarge" to 1dip.
BitmapCreator almost doesn't include any drawing methods. BitmapCreator doesn't replace B4XCanvas / Canvas. They are expected to be used together.
The exact details depend on the problem you are trying to solve.
For a drawing app you should probably use B4XCanvas as the main drawing target and use BitmapCreator if you need to apply all kinds of lower level effects.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.