Android Question dotted crop

strat

Active Member
Licensed User
Longtime User
Use a transparent panel on the imageview and write special routine that draw dotted line on the panel.
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
xD ty i go try but it aparent is much hard to beginer *-* i go try =)
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
i go use too xD i need make one scrop in another scrop xD
1 normal plain line another with dotted

have a way to use a png for make a dotted?


 
Upvote 0

strat

Active Member
Licensed User
Longtime User
You can use this code. I used an imageview instead of panel.



B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim iv As ImageView
    Dim c As Canvas
    Dim btn As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    iv.Initialize("iv")
    btn.Initialize("btn")
    Activity.AddView(iv,0,0,100%x,100%y)
    Activity.AddView(btn,40%x,90%y,20%x,10%y)
    btn.Text="Draw"
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub btn_click
   
    drawdotline(10%x,10%y,80%x,80%y)
End Sub

Sub drawdotline(x1,y1,x2,y2 As Int)
    Dim lx,ly As Int
    Dim rect1 As Rect
    c.Initialize(iv)
    rect1.Initialize(0,0,100%x,100%y)
    c.DrawRect(rect1,Colors.Transparent,True,1)
    lx=x1
    ly=y1
    Do While lx<(x2-1%x)
        c.DrawLine(lx,y1,lx+1%x,y1,Colors.Blue,1)
        c.DrawLine(lx,y2,lx+1%x,y2,Colors.Blue,1)
        lx=lx+2%x
    Loop
    Do While ly<(y2-1%y)
        c.DrawLine(x1,ly,x1,ly+1%y,Colors.Blue,1)
        c.DrawLine(x2,ly,x2,ly+1%y,Colors.Blue,1)
        ly=ly+2%y
    Loop
End Sub
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
one day I'll be a programmer just like you my dream, however almost impossible in Brazil ¬ ¬

thx man i go try tomorow
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…