B4J Tutorial Canvas inside a ScrollPane (Beginner-Tutorial) - Midimaster    Oct 23, 2020   (3 reactions) Now you can paint on the canvas as you like. Here it is a random graphics:
Sub DrawGraph
Dim Random, High, Low As Int
Canvas.DrawRect(0,0,1000,200,fx.colors.black,True, 0 )
For i=0 To 800 Step 2
Random =Rnd(-50,50)
If Random<0 Then
High=100+Random
B4J Library {B4X] A class to draw on canvas many types of arrows at any angle. - William Lancee    Aug 24, 2022   (19 reactions) Once again I found myself writing code to draw arrows on canvas.
@klaus has provided a basic technique that I also use: define the set of points on the arrow as a path and then draw the path.
https://www.b4x.-broken-line-arrow-head.43450/post-264259
I finally decided to write a more general class t B4J Question How to write an Ellipse on Canvas? - klaus (first post)    Aug 13, 2024   (3 reactions) Using a B4XCanvas you have the B4XPath.InitializeOval(Rect As B4XRect) method.
And use B4XCanvas.DrawPath method.
Be aware that DrawPath works differently than DrawRectangle and DrawCircle when the Filled property is False.
With DrawRectangle and DrawCircle, the Stroke is half on both sides if the B4J Question [Solved] Need help with Canvas.DrawText. - Dominik H    Dec 02, 2020 I'm at a loss here. I need to dynamically draw text with Canvas.DrawText, and while it works the first time around, when the text is changed it overlaps.
I've tried:
Canvas.ClearRect()
Canvas.DrawRect() - with fx.Colors.Transparent
Setting views invisible and visible again
Adding and removing canva B4J Library AsyncCanvas, B4XCanvas wrapper with Invalidate for B4J - max123    Jul 01, 2024   (6 reactions) Rotates the text before it is drawn. Invalidate As Commits the drawings. If AutoInvalidate is False (default) this must be called for the drawings to be updated. MeasureText (Text As String, Font As B4XFont) As B4XRect Measures single line texts and returns their width, height and the height above B4J Library jCanvasExt Extends Canvas methods - klaus    Aug 27, 2023   (20 reactions) Width As Double, Height As Double, Color As Paint, Filled As Boolean, LineWidth As Double) As String
Draws a Rectangle
x = left coordinate of the surrounding rectangle
Y = top coordinate of the surrounding rectangle
Width = width coordinate of the surrounding rectangle
Height = height coordinate B4J Question Canvas Problem. Leaving Artifacts. - keirS (first post)    Jun 23, 2020 MainForm.Show
Canvas1.DrawRect(0,0,Canvas1.Width,Canvas1.Height,fx.Colors.White,True,10)
'Canvas2.DrawRect(0,0,Canvas2.Width,Canvas2.Height,fx.Colors.Transparent,True,10)
Canvas2.DrawLine(100,100,200,200,fx.Colors.Blue,10)
Log(GetType(Canvas2))
End Sub
'Return true to allow the Wish XUI drawline/rectangle straight line as non antialised - Erel (first post)    Aug 02, 2019   (1 reaction) When I wrote my answer in post #2 I missed the fact that you were talking about Canvas. BitmapCreator.DrawRect should draw thin lines properly. B4J Question Drawing Arrow on Canvas - dieterp (first post)    Nov 13, 2020   (3 reactions) I managed to solve this query by using the function below
Sub canvas_arrow(fromx As Double, fromy As Double, tox As Double, toy As Double)
Dim headlen As Int = 10 ' length of head in pixels
Dim dx As Double = tox - fromx
Dim dy As Double = toy - fromy
Dim angle As Double = ATan2(dy, B4J Question Error: Canvas.DrawRect - Erel (first post)    Mar 31, 2019 Last parameter should be a number: https://www.b4x./?query=Canvas.DrawRect&product=b4j
It is the stroke width. Page: 1   2   3   4   5   6   7   Powered by ColBERT |