Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.

rubber banding

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-22-2008, 02:41 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 91
Default rubber banding

Hi,
maybe usefull for some GPS apps and track drawings:
Code:
Sub Globals
    
'Declare the global variables here.
    Dim Type(sx,sy,ex,ey)m As Int16
    draw = 
""
End Sub

Sub App_Start
    Form1.Show
    Form1.ForeLayer = 
true
End Sub


Sub Form1_MouseDown (x,y)
    m.sx = x
    m.sy = y
    Form1.Circle(x,y,
5,cRed,F)
    draw = 
true
End Sub

Sub Form1_MouseMove (x,y)
                         
If draw = true Then
        m.ex = x
        m.ey = y
        
Else
            m.ex = m.sx
            m.ey = m.sy
    
End If
    Form1.FErase(
0,0,Form1.Width,Form1.Height)
    Form1.FLine(m.sx,m.sy,m.ex,m.ey,cGreen)
End Sub

Sub Form1_MouseUp (x,y)
    Form1.Line(m.sx,m.sy,x,y,cGreen)
    Form1.Circle(m.sx,m.sy,
5,cRed,F)
    Form1.Circle(m.ex,m.ey,
5,cRed,F)
    draw = 
false
End Sub
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, Win7
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: iblue 747
Reply With Quote
  #2 (permalink)  
Old 12-03-2008, 10:51 AM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 91
Default rubber banding

Hi,
rubber banding improved. It’s faster and smoother now, with an additional feature. Play with timer1.interval to get the best performance. Could be useful for GPS and way point navigation.
Attached Files
File Type: sbp rubberband.sbp (2.1 KB, 54 views)
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, Win7
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: iblue 747

Last edited by wolfgang : 12-03-2008 at 11:44 AM. Reason: Edit: small bug saved
Reply With Quote
  #3 (permalink)  
Old 12-04-2008, 08:03 AM
Junior Member
 
Join Date: Nov 2008
Location: Germany
Posts: 18
Default

Hallo wolfgang,
pretty nice application and a good idea. Please allow me some annotation: The timer is not really necessary. You can write something like this:
Code:
Sub Form1_MouseMove(x,y)
    
If draw = False Then Return
...
Then the MouseMove event should include the timer code. In the headdist procedure, you can reduce the If-intersections from 8 to 4, if you use the sinus and not the arc tangent.
Maybe, it's a better Idea, when you not wipe out the Position Information?

Cheerio
VoDB
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT. The time now is 09:43 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0