Antonio,
A while back I asked about capturing signatures on the handheld. You suggested it may be easy to do using mouse events and setpixel(). I put together a little program using FWH to see if I could make it work on the desktop. The problem is when dragging the mouse the pixels set are too far apart unless you move the mouse very slowly. The following is a sample. Should I be doing something different or doing this a different way?
// Capture Signature
#include "FiveWin.ch"
static oWnd, lDown, hDC
function Main()
lDown := .F.
DEFINE WINDOW oWnd FROM 1, 1 TO 30, 50 ;
TITLE OemToAnsi( "Signature Capture with the mouse" ) ;
MENU BuildMenu()
oWnd:bLClicked := { || lDown := .T. }
oWnd:bLButtonUp := { || lDown := .F. }
oWnd:OnMouseMove:= { | obj, x, y, flags| DrawL(y,x) }
hDC := oWnd:GetDC()
ACTIVATE WINDOW oWnd
return 0
STATIC FUNCTION DrawL(y,x)
IF lDown
SetPixel(hDC, y, x, RGB(0,0,0) )
ENDIF
RETURN NIL
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "&File"
MENU
MENUITEM "&Clear" ACTION oWnd:Refresh()
ENDMENU
MENUITEM "&End" ACTION oWnd:End()
ENDMENU
return oMenu
Signatures
- Antonio Linares
- Site Admin
- Posts: 42519
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 75 times
- Contact:
Antonio,
When I slow the mouse speed down to slowest possible it draws the lines better but on the desktop it is very hard to draw with the mouse moving so slow. I don't know what the behaviour would be on the handheld.
Maybe someone could compile the simple sample I posted and see how it works on the handheld?
Thanks,
Randal Ferguson
When I slow the mouse speed down to slowest possible it draws the lines better but on the desktop it is very hard to draw with the mouse moving so slow. I don't know what the behaviour would be on the handheld.
Maybe someone could compile the simple sample I posted and see how it works on the handheld?
Thanks,
Randal Ferguson