[comp.sys.mac.programmer] PICT line thickness

heberlei@iris.ucdavis.edu (Todd) (02/28/89)

I am using the code in IM V pg. 89-90 to send a PICT file to a disk; I
then print it out with MacDraw on a laser printer.  The lines were a
little too coarse (sp? you know - thick) for me (I am using the
default pen size (1,1 I believe)).  Is there a way to get thinner
lines in a PICT file and printed by MacDraw?  Any help would be
greatly appreciated!

Thanks,

Todd Heberlein

heberlein@iris.ucdavis.edu      128.120.57.20

rick@Jessica.stanford.edu (Rick Wong) (02/28/89)

In article <3739@ucdavis.ucdavis.edu> heberlei@iris.ucdavis.edu (Todd) asks:
>
>					Is there a way to get thinner
>lines in a PICT file and printed by MacDraw?  Any help would be
>greatly appreciated!
>
>Thanks,
>
>Todd Heberlein
>
>heberlein@iris.ucdavis.edu      128.120.57.20


I use the following routine:

procedure PSScalePen(numer, denom: integer);
(***
    A tech-note sanctioned method to control line sizes -- the SetLineWidth
    PicComment, described in TN 175, tells the LaserWriter to multiply the
    the pen size by the given fraction.
***)
    const
	SetLineWidth = 182;	{PicComment for setting fractional line widths}
    var
	lineWidth: Point;
	hLineWidth: Handle;
	err: OSErr;
begin
    lineWidth.v := numer;
    lineWidth.h := denom;

    err := PtrToHand(@lineWidth, hLineWidth, sizeof(Point));
    {!!! Do error handling here}

    PicComment(SetLineWidth, sizeof(Point), hLineWidth);
    DisposHandle(hLineWidth);
end;


You can then do something like:

	PSScalePen(1, 4);

	{Draw stuff . . . }

	PSScalePen(4, 1);	{Restore normal pen scaling}


Rick "No, it's Hair Pie" Wong
rick@jessica.stanford.edu