[futurebasic] Re: Hi res printing of graphics

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Robert Cogburn <rcogburn@...>
Date: Mon, 4 Oct 1999 12:22:25 -0600
>One item of possible interest/"future resolution"; I've recently used one of
>my older apps, though newly revived and enhanced, "MacDraft". It has 3
>different width "hairlines": H, .5, .75; in addition to 1 (one pixel
>width). I
>suspect that the Hairlines routine could be enhanced without too much
>difficulty to provide these additional options as well.
>
>Sorry I forgot to indicate that "Hairlines" should be called after ROUTE
>_toPrinter.
>
>Joe Wilkins

Joe, the following is a simple adaptation to FB of a routine in Appendix
B of IM:Imaging

BEGIN RECORD LineWidth
dim v%
dim h%
END RECORD


REGISTER OFF
'-------------------------------------
_SetLineWidth  = 182                              'Postscript Comment for
hairlines
_LineWidthSize = 4                                  'Data size( the
LineWidth record)
'-------------------------------------
LOCAL FN SetLineWidth (oldPntr as POINTER, newPntr as POINTER)
DIM scaleHndl&
 scaleHndl& = FN NEWHANDLE (4)
 LONG IF scaleHndl& <> 0 AND SYSERROR = _noErr
      scaleHndl&..v% = oldPntr.h%
      scaleHndl&..h% = oldPntr.v%
      CALL PICCOMMENT (_setLineWidth, _LineWidthSize, scaleHndl&)
      scaleHndl&..v% = newPntr.v%
      scaleHndl&..h% = newPntr.h%
      CALL PICCOMMENT (_setLineWidth, _LineWidthSize, scaleHndl&)
      DEF DISPOSEH (scaleHndl&)
 END IF
END FN

IM explains how this will reset both Laser and Quickdraw printers from a
previous resolution to a new one (while in the same print job).
Apparently it works for some other printers too, maybe most printers???

The trick for setting different line widths is that the line width will
be the normal 1/72 inch times the fraction LineWidth.v/LineWidth.h, which
comes to 1/4 in the example you had. An example of calling this is

DIM oldWidth as LineWidth
DIM newWidth as LineWidth
oldWidth.v = 1: oldWidth.h = 1                 'for the first call
newWidth.v = 1: newWidth.h = 5              'to set width to 1/5 normal
DEF LPRINT
LONG IF NOT PRCANCEL
route _toPrinter
FN setLineWidth(oldWidth,newWidth)    'set hairlines

then set oldWidth equal to newWidth for the next callĀŠ

All the best,

     Robert