Signatures

Signatures

Postby Randal » Fri May 19, 2006 5:49 pm

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
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Antonio Linares » Fri May 26, 2006 6:33 am

Randal,

You may try to fine tune the mouse speed using SystemParametersInfo() and the SPI_SETMOUSE flag. Also check mouse_event().
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Randal » Fri May 26, 2006 8:38 pm

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
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 64 guests