*------------------------------------------------------------------------------- FUNCTION fSaveScr2Bmp(nEvent,mp1,mp2,oXbp,aPosBmp,aSizBmp,cNamBmp,oPareI,nBits,nTransC) LOCAL oProg,oPare,oPS,oBitmap,oPS1,oBitmapC LOCAL nXof:=0,nYof:=0,nCompr:=0 //no compresion nBits:=IF(nBits=NIL,1,nBits) //s.1610 oPS:= XbpPresSpace():new() oPS:create(oPare:winDevice()) oBitmap := GraSaveScreen(oPS,aPosBmp,aSizBmp,1,nBits,nTransC) fErase(cNamBmp) oBitmap:SaveFile(cNamBmp, XBPBMP_FORMAT_PNG,nCompr) //Nothing happens! oBitmap:SaveFile(cNamBmp+'.JPG',XBPBMP_FORMAT_JPG,nCompr) //DONE oBitmap:destroy() oPS:destroy() RETURN NIL *------------------------------------------------------------------------------- FUNCTION GraSaveScreen( oSourcePS, aPos, aSize,nPM,nBits,nTransC) LOCAL oBitmap := XbpBitmap():new():create( oSourcePS ) LOCAL oTargetPS := XbpPresSpace():new():create() LOCAL aSourceRect[4],aTargetRect aSourceRect[1] := aSourceRect[3] := aPos[1] aSourceRect[2] := aSourceRect[4] := aPos[2] aSourceRect[3] += aSize[1] aSourceRect[4] += aSize[2] aTargetRect := {0, 0, aSize[1]*nPM, aSize[2]*nPM} *---ss.06.2004 IF nTransC#NIL oBitmap:transparentClr:=nTransC ENDIF oBitmap:presSpace( oTargetPS ) oBitmap:make( aSize[1]*nPM, aSize[2]*nPM ) GraBitBlt( oTargetPS, oSourcePS, aTargetRect, aSourceRect ) RETURN oBitmap *-------------------------------------------------------------------------------