B4A Tutorial [B4X] Drawing with BitmapCreator - Erel    Dec 22, 2019   (13 reactions) Drawings are done with brushes (BCBrush). There are three ways to create brushes:
BC.CreateBrushFromColor
BC.CreateBrushFromBitmap
BC.CreateBrushFromBitmapCreator
DrawCircle creates the brush for you and calls DrawCircle2:
Public Sub DrawCircle (X As Float, Y As Float, Radius As Float, Color As In B4A Code Snippet [B4X] Animated change of theme / layouts - Erel    Aug 09, 2021   (21 reactions) 584770841
This is an example that demonstrates how Root.Snapshot + 2 BitmapCreators, with the old and new layouts can be used to create a nice transition between two layouts.
Private Sub SetNewTheme As ResumableSub
If bc1.IsInitialized = False Then
bc1.Initialize(Root.Width, Root.Heig B4A Library [B4X] [XUI] AnotherProgressBar - Erel    Jan 20, 2019   (20 reactions) The relevant code is: Private Sub BusyLoop Dim MyIndex As Int = BusyIndex Do While MyIndex = BusyIndex If Vertical Then BusyBrush.SrcOffsetY = BusyBrush.SrcOffsetY + 3 Else BusyBrush.SrcOffsetX = BusyBrush.SrcOffsetX - 3 End If Dim tasks As Li B4J Question 3 gradiant fill with drawarc - Erel (first post)    Aug 01, 2023   (1 reaction) There is no built-in sweep gradient like this in BitmapCreator. It is possible to create one with some work (check the source code).
Another option is to use a left right gradient:
144313
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Dim Grad B4i Question BitmapCreator FillRadialGradient error! - Erel (first post)    Sep 26, 2021   (1 reaction) FillRadialGradient(Array As Int(0xFFFF9D00, 0xFFFFFF00, 0xFFFF9D00),bc2.TargetRect)
Dim brush As BCBrush = Bc.CreateBrushFromBitmapCreator(bc2)
brush.SrcOffsetX = (Bc.mWidth - bc2.mWidth) / 2
brush.SrcOffsetY = (Bc.mHeight - bc2.mHeight) / 2
For angle = 0 To 359 Step 30
Bc.Dr B4A Question 360 in 10 seconds - Erel (first post)    May 20, 2020   (5 reactions) Sub Process_Globals Private fx As JFX Private MainForm As Form Private ImageView1 As B4XView Private bc As BitmapCreator Private xui As XUI End Sub Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("1") 'Load the layout file. Bug? B4XCanvas InitializeArc - Erel (first post)    May 14, 2019   (1 reaction) This is the behavior of the native API. You will need to use InitializeOval for this case. Note that you can also achieve this effect with BitmapCreator: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("1") bc.Initialize(ImageView1.Width, ImageView1.Height) Dim brush As BCBr B4A Question How crop with b4xcanvas and a trasparent color? - Erel (first post)    Aug 04, 2019   (2 reactions) Initialize(bmp.Width + 1, bmp.Height + 1) Dim brush As BCBrush = bcbrush.CreateBrushFromBitmapCreator(bcbrush) Dim r As B4XRect r.Initialize(0, 0, bc.mWidth - 1, bc.mHeight - 1) bc.DrawRectRounded2(r, brush, True, 0, Radius) If TopLeft = False Then r.Initialize(0, 0, Radius, Ra B4A Question Telegram theme change animation - AmirMK82 (first post)    Aug 23, 2021 I have tested it(not worked), And this is my code : Sub drawWithAnimatoin Dim bc As BitmapCreator Dim brush As BCBrush bc.Initialize(100%x, 100%y) Dim bmp As B4XBitmap = Root.Snapshot brush = bc.CreateBrushFromBitmap(bmp) Root.Color = Colors.White For i=0 To Pan B4A Question round circular progress bar - Erel (first post)    Sep 20, 2022   (6 reactions) Change DrawValue to:
Private Sub DrawValue(Value As Float)
bc.DrawRect2(bc.TargetRect, TransparentBrush, True, 0)
mLbl.Text = $"$1.0{Value}"$
Dim startAngle = -90, sweepAngle = Value / 100 * 361 As Float
bc.DrawArc2(cx, cy, radius, emptyBrush, False, stroke, startAngle, -(360 - swee Page: 1   2   3   4   5   6   7   Powered by ColBERT |