I�m creating an offscreen display of my actual screen. That
will be saved as a record. I use the following function:
WinHandle winCroquiHandle;
BitmapPtr saveScreen(RectangleType *coord){
BitmapPtr croquiBmpPtr=NULL;
UInt16 rowBytes,height;
DWord romVersao;
winCroquiHandle=WinCreateOffscreenWindow(coordenadas->extent.x,coordenadas->
extent.y,genericFormat,&err);
if(!err){
WinCopyRectangle(NULL,winCroquiHandle,coordenadas,0,0,scrCopy);
rouBytes=winCroquiHandle->bitmapP->rowBytes;
height=winCroquiHandle->bitmapP->height;
croquiBmpPtr=MemPtrNew(sizeof(BitmapType)+(bytesLinha*altura));
if (croquiBmpPtr){
MemSet(croquiBmpPtr,sizeof(BitmapType)+(bytesLinha*altura),0);
croquiBmpPtr->width=winCroquiHandle->bitmapP->width;
croquiBmpPtr->height=winCroquiHandle->bitmapP->height;
croquiBmpPtr->rowBytes=winCroquiHandle->bitmapP->rowBytes;
croquiBmpPtr->pixelSize=winCroquiHandle->bitmapP->pixelSize;
croquiBmpPtr->nextDepthOffset=NULL;
FtrGet(sysFtrCreator,sysFtrNumROMVersion,&romVersao);
if(romVersao>=versao35){
MemMove((Ptr)((ULong)(croquiBmpPtr)+sizeof(BitmapType)),BmpGetBits
(winCroquiHandle->bitmapP),BmpBitsSize(winCroquiHandle->bitmapP));
}else{
MemMove((Ptr)((ULong)(croquiBmpPtr)+sizeof(BitmapType)),winCroquiHandle->
displayAddrV20,rowBytes*height);
}
}
WinDeleteWindow(winCroquiHandle,false);
}
return croquiBmpPtr;
}
I runs okay on my palm IIIc, when I use the APIs BmpGetBits
and BmpBitsSize or even the old structure displayAddrV20.
But if I try on a IIIx, it cracks. But it doesnt seem to be
the real problem. It starts to go weird when I try to read
the offscreen(winCroquiHandle), which is created but doesnt
have the values:
winCroquiHandle->bitmapP->width;
winCroquiHandle->bitmapP->height;
winCroquiHandle->bitmapP->rowBytes;
In my opinion, the problem is within the function
WinCopyRectangle(NULL,winCroquiHandle,coord,0,0,scrCopy)
which doesnt fill the values correctly. Theres no error
returning...
I Really dont understand, I have picked the Signature and
PalmPaint sources from 3Com and Falchnet, but they dont work
in my old OS�s.
________________________________________________
Don't E-Mail, ZipMail! http://www.zipmail.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/