Android Question Accelerated Surface Canvas and B4A Canvas on DrawCircle StrokeWidth set to high.

Discussion in 'Android Questions' started by Michael Mejias, Nov 16, 2018.

Similar threads

B4A Code Snippet Geo-Zone Determination (Point in Polygon)
Games [XUI2D] Example Pack
B4A Code Snippet Get panel touch direction
B4A Code Snippet Bicubic curves
B4A Code Snippet Mathemetics Pendulum
  1. Michael Mejias

    Michael Mejias Member Licensed User

    I have a circle and the strokewidth is set to high. It's fine when drawing it on view even if the strokewith is very high, but when I save it to file, Bitmap.WriteToStream, the output is different from what I saw on the canvas. It's like the strokewidth is using different size.

    Here is my code in saving to file:

    Sub Addframe_Click
        onionbitmap = AcSf2.Bitmap
    'IU.AlterColors(AcSf2.Bitmap,100,360,1) 'Set the bitmap alpha to 100

    Dim out As OutputStream
        out = 
    File.OpenOutput(File.DirInternal,functions.currentframe & ".jpg",False)
    If functions.maxframe < functions.currentframe Then
            functions.maxframe = functions.currentframe
    End If
        functions.currentframe = functions.currentframe + 
    End Sub

    And here is my code when drawing to canvas:

    Sub AcSf2_Draw(Ac As AS_Canvas)
    Dim a As Long
    Dim b As Long
    Dim fcon As Long
    Dim x1,y1,x2,y2 As Float
    For b=0 To functions.figurecount-1
    For a=1 To cnt(b)-1
                fcon = con(b,a)
                x1 = x(b,a)
                x2 = x(b,fcon)
                y1 = y(b,a)
                y2 = y(b,fcon)
    If t(b,a) = 0 Then
    else if t(b,a) = 1 Then
    2 + x1/2,y2/2 + y1 / 2,Sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 -y1)))/2,Colors.White,True,w(b,a),True)
    2 + x1/2,y2/2 + y1 / 2,Sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 -y1)))/2,cl(b,a),False,w(b,a),True)
    'Log(Sqrt(((x(b,con(b,a)) - x(b,a)) * (x(b,con(b,a)) - x(b,a))) + ((y(b,con(b,a)) - y(b,a)) * (y(b,con(b,a)) - y(b,a) )))/2)
                End If

    End Sub
    Attach is image. There are two circles, the one with no hole is the one on the canvas, and the one with the hole is the one from file I loaded. Thanks.

    Attached Files:

  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