Fergal,

I'm having the same problem so I gave the code a try. It breaks on the call.

                >     theHeight = theWindowHandle->gDeviceP->height;
On 3.5 does this work for you?

Thanks


----- Original Message -----
From: "Fergal Moran" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 11:07 AM
Subject: RE: Capturing Signatures


> Hi Christopher
>
> The signature++ application does not work with 3.5 or above - I don't have
the source for it here at the moment so I can't remember why but I can tell
you what to change.
>
> Find the GetSignatureBitmap function and replace it with and it should
work
>
> BitmapPtr GetSignatureBitmap(RectangleType* theBoundsPtr){
>
>   WinHandle  theWindowHandle;
>   UInt16    theError;
>   BitmapPtr  theBitmap=NULL;
>   UInt16    theRowBytes, theHeight;
>
>
>   // Create an offscreen window to copy the bits bounded by the gadget
into.
>   // This will make converting the window into a bitmap a little easier
for me
>   // I could just copy the screen bits directly into the bitmap, but that
>   // would require more pointer arithmetic and POSE complains when you
read
>   // directly from the screen.
>
>   theWindowHandle = WinCreateOffscreenWindow( theBoundsPtr->extent.x,
>               theBoundsPtr->extent.y, screenFormat, &theError );
>
>   if (!theError){
>
>     WinCopyRectangle( NULL, theWindowHandle, theBoundsPtr, 0, 0,
scrCopy );
>
>     theRowBytes = theWindowHandle->gDeviceP->rowBytes;
>     theHeight = theWindowHandle->gDeviceP->height;
>
>     theBitmap = (BitmapPtr)MemPtrNew( sizeof(BitmapType) +
(theRowBytes*theHeight) );
>     if (theBitmap){
>       MemSet( theBitmap, sizeof(BitmapType) + (theRowBytes*theHeight),
0 );
>
>       theBitmap->width = theWindowHandle->gDeviceP->width;
>       theBitmap->height = theWindowHandle->gDeviceP->height;
>       theBitmap->rowBytes = theWindowHandle->gDeviceP->rowBytes;
>       theBitmap->pixelSize = theWindowHandle->gDeviceP->pixelSize;
>       theBitmap->nextDepthOffset = NULL;
>
>       theBitmap->flags.compressed = theWindowHandle->gDeviceP->compressed;
>
>       theBitmap->version = 1;
>       theBitmap->flags.hasColorTable = 0;
>
>       MemMove( (Ptr)((ULong)(theBitmap) + sizeof(BitmapType)),
>             theWindowHandle->gDeviceP->baseAddr, theRowBytes *
theHeight );
>     }
>
> //    if (theWindowHandle->bitmapP)
> //      theBitmap = WinGetBitmap(theWindowHandle);
>     WinDeleteWindow( theWindowHandle, false );
>   }
>
>   return theBitmap;
> }
>
> Hope this helps you out!
>
> Fergal
>
> > -----Original Message-----
> > From: Christopher Kabat [mailto:[EMAIL PROTECTED]]
> > Sent: 26 September 2001 15:55
> > To: Palm Developer Forum
> > Subject: Re: Capturing Signatures
> >
> >
> > OK, here's where I show my complete newness and ignorance to
> > the Palm platform.  I got the signature++ sample and couldn't
> > get it to compile.  I'm using CodeWarrior for Palm OS V7
> > which originally installed the 3.5 SDK.  I changed the
> > include of pilot.h to palmos.h and ended up with a plethora
> > of compile errors and thats when I decided to just take the
> > code out of the
> > signature++ app and put it in my starter app.  Is it possible that I'm
> > running into some backwards compatibility issues,  I wrote an
> > entire app with the 3.5 sdk and it runs on my 3.32 symbol
> > unit fine.  I'm so confused.
> >
> > Thanks
> > Chris Kabat
> > "Avilla, Dane" <[EMAIL PROTECTED]> wrote in message
> news:63387@palm-dev-forum...
> >
> > Hmm . . . Well, I wrote a bit long email, and then thought I would
> > give
> the
> > sample code a try.  I was able to get the Signature++ code working
> > fine on
> a
> > 3.3 debug ROM in POSE.  I even added some code to draw the saved
> > bitmap to the screen above the signature input box and that worked.
> >
> > I had to modify the app so that it allowed itself to run on an OS 3.3
> device
> > (edit the call to RomVersionCompatible in StarterPilotMain), and then
> > I added a WinDrawBitmap call at the end of CaptureSignature which just
> > draws the saved bitmap to the screen after the user lifts the pen from
> > drawing input.
> >
> > // Turn the drawing into a bitmap and save the bitmap in a global
> > gBitmapPtr = GetSignatureBitmap( &theGadgetBounds );
> >
> > // Restore the old clipping rectangle
> > WinSetClip( &theClipRectangle );
> >
> > // NEW LINE ADDED
> > WinDrawBitmap (gBitmapPtr, 5,5);
> > }
> >
> > This appears to be working fine in my test case.  Are you able to get
> > the example working?  If so, perhaps there is a problem in how you
> > transformed the code from the Signature++ example into your own code .
> > . .
> >
> > Cheers,
> >
> > -DGA
> >
> >
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to