PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Can u 'write' with the stylus in GapiDraw? URGENT

R can u just draw straight lines. I'm trying to write a program that can write letters in Gapidraw on a Dell ppc. Can anyone help me? its urgent. How can u use the Stylus methods, ive done the buttons before in class but never looked at the stylus methods.

Thanks for anyone who helps me
Jonny
You can use OnStylusMove() and record where it moves to. Or if you just want straight lines, record the starting point OnStylusDown() and the end point OnStylusUp(), and draw a line using those two points.
dan.p wrote:You can use OnStylusMove() and record where it moves to. Or if you just want straight lines, record the starting point OnStylusDown() and the end point OnStylusUp(), and draw a line using those two points.


During StylusMove() how can I change the colour of the pixels when the stylus moves around the screen? What method could I use? (SetPixel() or SetPixels() or is there a better way of doing this?
Add two member variables:
1. BOOL - bStylusDown
2. CPoint - LastStylusPosition

Capture StylusDown to set bStylusDown to TRUE and set LastStylusPosition to the stylus position. Capture StylusUp to set bStylusDown to FALSE. On StylusMove, draw a line (DrawLine) from LastStylusPosition to the new position. Set LastStylusPosition to the new position.

There, you can now "draw" on you Pocket PC. :-)
Thanks Johan for the information but i'm getting stuck on the StylusMove with the DrawLine(), here's what i've put

Code:
HRESULT CMyApplication::StylusMove(POINT p)
{

backbuffer.DrawLine(LastStylusPosition.x, LastStylusPosition.y, p.x, p.y,RGB(128,128,128),0,0);
LastStylusPosition=p;

return S_OK;
}


its coming up with backbuffer undeclared and left of '.DrawLine' must have class/struct/union type.

Was wondering where i'm going wrong? (the last two parameters for DrawLine is zero cuz i never new what to put.)

Thanks for the help