B4A Code Snippet Draw on top of other apps permission - Erel    Sep 5, 2023   (17 reactions) As JavaObject ctxt.InitializeContext If settings.RunMethod("canDrawOverlays"..., Args() As Object) Return settings.RunMethod("canDrawOverlays", Array(ctxt)) Else.... Usage example: Sub Button1_Click Dim c As RequestDrawOverPermission 'this is the name... B4A Code Snippet [B4X] [XUI] Accurate Text Measurement and Drawing - Erel    Dec 12, 2022   (54 reactions) .MeasureText(Text, Fnt) Dim BaseLine As Int = CenterY - r.Height / 2 - r.Top cvs1.DrawText(Text, CenterX, BaseLine, Fnt, Clr, "CENTER") Sub that also draws the border and the baseline: Sub DrawTextWithBorder (cvs1 As B4XCanvas, Text As String, Fnt As B4XFont, Clr As Int, CenterX As Int... - r.Height / 2 - r.Top cvs1.DrawText(Text, CenterX, BaseLine, Fnt, Clr, "CENTER") cvs1.DrawCircle(CenterX, CenterY, 3dip, xui.Color_Blue, True, 0) r.Initialize(CenterX - r.Width / 2... Games [XUI2D] Drawing lines example - Erel    Sep 6, 2018   (9 reactions) This is really a nice example. You draw objects with your finger and they almost come to life: 288562763 Run with debug drawing to see the bodies structure: https://www.b4x.com/basic4android/images/SS-2018-09-06_18.25.59.png Note that chain shapes cannot collide with other chain shapes in box2d. Instead we create bodies with multiple polygon shapes. You can play with the angle interval to make it more accurate: X2.GraphicCache.PutGraphic2(gname, Array(sb), antialias, 3) The example... B4A Library [B4X] [XUI] AS Draw (FabricView and CanvasView) - Alexander Stolte    Apr 28, 2024   (47 reactions) a background image draw, erase or draw lines undo and redo clear all set color, thickness and background color enable or disable the drawing import and export the drawing for later use export the drawing as image or the complete view 90896 Draw what you want 90899 use a eraser 90900 set a background image 91567 draw lines 91738 Examples Dim Out As OutputStream Out = File.OpenOutput(File.DirApp...) Out.Close AS Draw Author: Alexander Stolte Version: 1.08 ASDraw Events: Touch (Action As Int, XY... Share My Creation Draw Floor Plan - aeric    Feb 3, 2025   (7 reactions) 161343 GitHub: https://github.com/pyhoon/Floor-Plan-B4A I am not good with drawing using finger. I just do a quick sketch for screenshot. Please suggest or improve the project. Thanks.... B4J Library [B4X] [XUI] BitmapCreator - Pixels, Drawings and More - Erel    Mar 31, 2019   (23 reactions)   tags: B4X XUI BitmapCreator, bitmap image creator from a different BitmapCreator to this BitmapCreator. - Methods to draw a bitmap or a different BitmapCreator to this BitmapCreator. - Method to draw gradients. - And a few other methods. Scaling 1... for the transparency to have its expected effect. This is called blending. When you call DrawBitmap or DrawBitmapCreator you can choose whether to skip blending or not. It is significantly faster to skip blending, though drawing with blending will be fast enough in most cases. There is also... Wish DrawBitmap no source rectangle - klaus    Nov 18, 2014 In B4A the DrawBitmap method has a SourceRectangle parameter to draw a part of the source bitmap. In B4i the SourceRectangle parameter is missing. Same for DrawBitmapRotated. Is this an iOS limitation ?... B4A Code Snippet Drawing Multiline Text - Erel    May 12, 2020   (20 reactions) of drawing multiline text on a PDF document (Printing library): Sub Process_Globals Private rp... = bmp.Width / bmp.Scale rect.Height = bmp.Height / bmp.Scale pdf.Canvas.DrawBitmap(bmp... B4A Tutorial [B4X] Drawing with BitmapCreator - Erel    Dec 22, 2019   (13 reactions) drawing features. Background At its core BC holds an array of bytes that represent an image... bc.Initialize(100%x, 100%y) bc.DrawCircle(100dip, 100dip, 50dip, xui.Color_Red, True, 10dip) bc.DrawLine(0, 0, bc.mWidth, bc.mHeight, 0xff0000ff, 5dip) Activity.SetBackgroundImage(bc.Bitmap) 'we can continue to use 'bc' End Sub New drawing methods The following drawing methods were added in v4.5: DrawLine, DrawCircle, DrawRect, DrawRectRounded and DrawPath... B4A Code Snippet [B4X] [XUI] Faster* DrawPolygon Method - Erel    Jun 24, 2018   (5 reactions) You can draw polygons with B4XCanvas.DrawPath. The following code calls B4XCanvas.DrawPath on B4A and B4i and calls a different method in B4J. DrawPath in B4J is slower than the other drawing methods... if you encountered a performance issue with B4XCanvas.DrawPath in B4J: 'Example Sub Page1_Click DrawPolygon(cvs, Array (Array As Int(100dip, 100dip), Array As Int(200dip, 0...)), _ xui.Color_Red, True, 2dip) cvs.Invalidate End Sub Sub DrawPolygon (cvs1 As B4XCanvas, Points... Page: 1   2   3   4   5   6   7   |