Hi I'm learing how to use canvas and I like it.
But my knowledge about geometry is really bad, I need to read it again.
I try to draw rectangles and work so so, that's because I can draw the rectable if I paint from the left to the right, but I paint the right to the left not show the rectangle. I show my bad code.
I try to draw an arrow with B4xpath and .Lineto and I cant at the moment, then I try with draw a bitmap with an arrow inside and goes crazy in some rotations.
Arrow Video:
Rectangle:
But my knowledge about geometry is really bad, I need to read it again.
I try to draw rectangles and work so so, that's because I can draw the rectable if I paint from the left to the right, but I paint the right to the left not show the rectangle. I show my bad code.
B4X:
Rectangulo.Top=posY_at_click
Rectangulo.Left=posX_at_click
Rectangulo.Bottom = y
Rectangulo.Right= X
canvas_temp.DrawRect(Rectangulo, xui.Color_Black, False, 2)
I try to draw an arrow with B4xpath and .Lineto and I cant at the moment, then I try with draw a bitmap with an arrow inside and goes crazy in some rotations.
B4X:
Rectangulo.Top=posY_at_click
Rectangulo.Left=posX_at_click
Rectangulo.Bottom = y
Rectangulo.Right= X
angulo = ATan2D(Y-posY_at_click, x-posX_at_click)
canvas_temp.DrawLine(posX_at_click, posY_at_click, X, Y, xui.Color_Black, 2)
canvas_temp.DrawBitmapRotated(fx.LoadImageSample(File.DirAssets, "flecha1.png", 80dip, 80dip),Rectangulo, angulo)
Arrow Video:
Rectangle:
Last edited: