Android Question B4XCanvas "setAntiAlias" method

Discussion in 'Android Questions' started by yiankos1, Dec 15, 2017.

  1. yiankos1

    yiankos1 Active Member Licensed User

    Hello my friend,
    How can i set antialias at b4x canvas?

    Dim Obj1 As Reflector
    Dim Canv As Canvas
    ' initialize on what you want
       Obj1.Target = Canv
       Obj1.Target = Obj1.GetField(
    This field(paint) does not exists.
  2. Peter Simpson

    Peter Simpson Expert Licensed User

    Hello try this, hopefully it will do the trick for you.

    Sub CanvasRoutineSub
    'Draw canvas sub
         Dim CanvasMain As Canvas

    'Put the rest of your canvas code here
    End Sub

    'Set Anti Alias
    Sub SetAntiAlias (Canvas1 As Canvas)
    Dim Ref As Reflector
             Ref.Target = Canvas1

    Dim NativeCanvas As Object = Ref.GetField("canvas")
    Dim PaintFlagsDrawFilter As Object = Ref.CreateObject2(""Array As Object(01), Array As String(""""))

         Ref.Target = NativeCanvas
    "setDrawFilter"Array As Object(PaintFlagsDrawFilter), Array As String(""))
    End Sub
    Last edited: Dec 15, 2017
    DonManfred likes this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    Antialiasing is enabled by default in B4XCanvas.
    yiankos1 likes this.
  1. 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.
    Dismiss Notice