Android Question dotted crop

Douglas Farias

Expert
Licensed User
Longtime User
hi i m making a crop with this sample
http://www.b4x.com/android/forum/threads/resize-and-crop.19550/#post-113884

i m attached the original image

but my question is how can i set a dotted crop?

like this
timelineyes.jpg
 

Attachments

  • ResizeAndCrop.jpg
    ResizeAndCrop.jpg
    54.1 KB · Views: 375
Use a transparent panel on the imageview and write special routine that draw dotted line on the panel.
 
Upvote 0
xD ty i go try but it aparent is much hard to beginer *-* i go try =)
 
Upvote 0
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? :rolleyes:


sem-t%C3%ADtulo-jpg.24736
 
Upvote 0
You can use this code. I used an imageview instead of panel.



Code: Copy
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
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
Back
Top