pjy100@csc.anu.oz (10/31/89)
Can anyone on the net shed some light on the following. I am tring to use
the polygon smoothing piccomment for Laserwriter printing and can't get it
to work. What is wrong with the following chunk of Think Pascal 2.01 code?
program testLW (input, output);
uses
macprint;
const
polybegin = 160;
polyend = 161;
picplyclo = 165;
polysmooth = 164;
polyignore = 163;
fpolyframe = 1;
fpolyfill = 2;
fpolyclose = 4;
type
pvh_type = ^ptr;
var
pvh: pvh_type;
hprint: thprint;
pict: pichandle;
r: rect;
procedure print_it;
var
ok: boolean;
myprport: tpprport;
prstatus: tprstatus;
saveport: grafptr;
begin
getport(saveport);
if hprint = nil then
hprint := thprint(newhandle(sizeof(tprint)));
ok := prvalidate(hprint);
ok := prjobdialog(hprint);
if ok then begin
myprport := propendoc(hprint, nil, nil);
if prerror = noerr then begin
propenpage(myprport, nil);
if prerror = noerr then begin
setport(@myprport^.gport);
drawpicture(pict, r);
end;
end;
prclosepage(myprport);
end;
prclosedoc(myprport);
if (hprint^^.prjob.bjdocloop = bspoolloop) and (prerror = noerr) then
prpicfile(hprint, nil, nil, nil, prstatus);
setport(saveport);
end;
begin {TestLW}
propen;
setrect(r, 30, 40, 480, 250);
setdrawingrect(r);
showdrawing;
hprint:=nil;
pict := openpicture(r);
piccomment(polybegin, 0, nil);
piccomment(picplyclo, 0, nil);
pvh := pvh_type(newhandle(1));
pvh^^ := fpolyframe + fpolyclose;
piccomment(polysmooth, 1, handle(pvh));
{draw something}
moveto(225, 20);
line(100, 80);
line(-100, 80);
line(-100, -80);
line(100, -80);
piccomment(polyend, 0, nil);
closepicture;
print_it;
{look at test picture on screen}
drawpicture(pict, r);
killpicture(pict);
disposhandle(handle(hprint));
disposhandle(handle(pvh));
end.
_____
The output from this is a blank page. Any ideas ?