FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

DRAWING

Print a GWorld


I think it is much easier than what you have laid out.

oldCurs = system(_lastCurs)
CURSOR(_arrowCursor)
DEF LPRINT

LONG IF PRCANCEL = 0
  CURSOR (_PrinterCursor)


  LONG IF gNameWorld&
    CALL GETGWORLD(currPort&,currDevice&)
    CALL SETGWORLD(gNameWorld, currDevice&)
    CALL SETRECT(srcT,0,0,gRosterH,gRosterV)
    pHndl& = USR GETPICT(srcT)
    CALL SETGWORLD(currPort&,currDevice&)

    ROUTE _toPriner
    PICTURE (0,0),pHndl&
    DEF DISPOSEH(pHndl&)

  END IF
END IF
CURSOR oldCurs

Note: Untested code. I just typed it in.

Problems with original stuff...

-The printer uses a separate device record from the screen or Gworlds - "LONG IF gNameWorld& AND currPort&" doesn't work as you would expect. It would have needed to be LONG IF gNameWorld& <> 0 AND currPort& - Lock pixels is not required in the sample I used.
- I didn't see where you DIM'd srcT. (Probably not in this snippet.) Failure to do so would mean a crash.

-STAZ ~)~


Try something like this.
Before your ROUTE _toPrinter line, do a pictHndl& = FN OPENPICTURE (rect) and then copybits the gworld into the same gworld it's already in (source and destination the same). Then CLOSEPICTURE. That should leave you with a PICT handle of the gWorld. Now do your ROUTE _toPrinter and then PICTURE (0,0), pictHndl& with pictHndl& being the handle you just got from the OPENPICTURE/CLOSEPICTURE.

Al Staffieri Jr.