[comp.sys.mac.programmer] Color Printing with Color QuickDraw

emb1354@uxf.cso.uiuc.edu (10/06/88)

Yeah, no problem.  If the printer's GrafPort is opened in a color environment,
(with color selected on the Mac][, see Monitors in Control Panel), it will be
a CGrafPort and you can use RGBForeColor and RGBBackColor calls.  How it will
affect the individual printers is variable.  For example, the LaserWriter only
supports black and white colors.  If, however, you want to use Palettes, you've
got to work a little harder.

*****************************************************************
*  Eric M. Berdahl            *  "Y'know, there's alot of air"  *
*  PsiWare Software, not inc. *       -Robert Miller            *
*  emb1354@uxf.cso.uiuc.edu   *                                 *
*****************************************************************

kaufman@polya.Stanford.EDU (Marc T. Kaufman) (10/08/88)

In article <1234600010@uxf.cso.uiuc.edu> emb1354@uxf.cso.uiuc.edu writes:

>Yeah, no problem.  If the printer's GrafPort is opened in a color environment,
>(with color selected on the Mac][, see Monitors in Control Panel), it will be
>a CGrafPort and you can use RGBForeColor and RGBBackColor calls.

Not true.  The printer driver will open whatever kind of GrafPort it wants.
Color printers usually prefer to open CGrafPorts.  Palette management is
automatic (if you pay no attention to the Driver behind the curtain).

Marc Kaufman (kaufman@polya.stanford.edu)

emb1354@uxf.cso.uiuc.edu (10/09/88)

/* Written  9:45 pm  Oct  6, 1988 by alcmist@well.UUCP in uxf.cso.uiuc.edu:comp.sys.mac.programmer */
I've tried printing to an IW II with a color ribbon from several color
Mac II programs.  The output is always black and white.  Apparently the only
way to get color from the Imagewriter driver is to talk Classic Quickdraw
color to it.

Answer:  Maybe the printer's GrafPort is an old-style GrafPort.  If that is the
case, you must use the ForeColor() and BackColor() calls.  If, however, the
port is a CGrafPort, use the RGBForeColor() and RGBBackColor() or equivalent
Palette manager calls.


*****************************************************************
*  Eric M. Berdahl            *  "Y'know, there's alot of air"  *
*  PsiWare Software, not inc. *       -Robert Miller            *
*  emb1354@uxf.cso.uiuc.edu   *                                 *
*****************************************************************

emb1354@uxf.cso.uiuc.edu (10/10/88)

>Color printers usually prefer to open CGrafPorts.  Palette management is
                                                    |--------------------
>automatic (if you pay no attention to the Driver behind the curtain).
 --------|

Are you sure about that?  After opening a printer GrafPort, which BTW was a
real CGrafPort, and trying to use palettes, all I could get was black.  I
had to go through great contorsions to get palettes to work at all, and even
then had to be carefull to do my own garbage collection on them before disposing
of the printer stuff.  If you know of a way to make Palettes truely automatic,
I'd love to know about it and save myself some hassle.


*****************************************************************
*  Eric M. Berdahl            *  "Y'know, there's alot of air"  *
*  PsiWare Software, not inc. *       -Robert Miller            *
*  emb1354@uxf.cso.uiuc.edu   *                                 *
*****************************************************************

anson@spray.CalComp.COM (Ed Anson) (10/11/88)

In article <1234600012@uxf.cso.uiuc.edu> emb1354@uxf.cso.uiuc.edu writes:
>I've tried printing to an IW II with a color ribbon from several color
>Mac II programs.  The output is always black and white.  Apparently the only
>way to get color from the Imagewriter driver is to talk Classic Quickdraw
>color to it.
>
>Answer:  Maybe the printer's GrafPort is an old-style GrafPort.

Right.

All of Apple's printer drivers use only the classic GrafPort. Color
Quickdraw calls to such a port always yield either black or white. The
conversions, to the classic port from color calls, do not take color into
account.

Unfortunately, this means that something drawn in a light color gets drawn
solid white on a Mac Plus or SE. It doesn't show very well on a white
background.

However, the reverse is true. Classic QuickDraw color calls are automatically
translated into corresponding Color QuickDraw actions when drawing into a
color port. Apparently, that's why several applications still use classic
quickdraw to provide color for the Mac II. It's more compatible with the
existing printer drivers and with B&W systems.
-- 
=====================================================================
   Ed Anson,    Calcomp Display Products Division,    Hudson NH 03051
   (603) 885-8712,      anson@elrond.CalComp.COM

casseres@Apple.COM (David Casseres) (10/12/88)

In article <1234600013@uxf.cso.uiuc.edu> emb1354@uxf.cso.uiuc.edu writes:

>...  After opening a printer GrafPort, which BTW was a
>real CGrafPort, and trying to use palettes, all I could get was black.

Unless I am misreading this, there is still some confusion about printer
grafPorts.  The port is ALWAYS opened by the printer driver, and all
current Apple printer drivers initialize it to a black/white grafPort, not
a CGrafport.  This is true even if you pass in a pointer to a port that
you have allocated yourself; the reason you are allowed to pass a non-NIL
pointer is just so you can control the allocation of the space.  Hardly
anyone cares about this, so the pointer is usually a NIL.

If you open a color grafport and pass its pointer in when you call PrOpenDoc,
it just gets re-opened as a b/w grafPort (with current Apple drivers).

David Casseres

kaufman@polya.Stanford.EDU (Marc T. Kaufman) (10/13/88)

In article <105@internal.Apple.COM> casseres@Apple.COM (David Casseres) writes:
>In article <1234600013@uxf.cso.uiuc.edu> emb1354@uxf.cso.uiuc.edu writes:

->...  After opening a printer GrafPort, which BTW was a
->real CGrafPort, and trying to use palettes, all I could get was black.

>Unless I am misreading this, there is still some confusion about printer
>grafPorts.  The port is ALWAYS opened by the printer driver, and all
>current Apple printer drivers initialize it to a black/white grafPort, not
>a CGrafport.  This is true even if you pass in a pointer to a port that
>you have allocated yourself...

>If you open a color grafport and pass its pointer in when you call PrOpenDoc,
>it just gets re-opened as a b/w grafPort (with current Apple drivers).

Of course, Dave, SOME drivers open CGrafPorts (but not Apple's... at least not
until Apple discovers color printing) ;-)

In particular, the Mirus FilmPrinter and Tektronix printer both open CGrafPorts
for their printing.  In this case, even if you attempt to give them B/W
GrafPorts, a Color port will be opened and returned.  In the Mirus case, at
least, there is every evidence that palettes work properly.

Marc Kaufman (kaufman@polya.stanford.edu)

casseres@Apple.COM (David Casseres) (10/14/88)

In article <4427@polya.Stanford.EDU> kaufman@polya.Stanford.EDU (Marc T. Kaufman) writes:

>Of course, Dave, SOME drivers open CGrafPorts (but not Apple's... at least not
>until Apple discovers color printing) ;-)

Uhh... did I imply otherwise?  Didn't mean to.  BTW I personally think that
even B/W printers should open a CGrafPort on a color machine, allowing the
application to draw in color and the printer driver to convert to B/W in
whatever way best suits the particular type of printer.

David Casseres

emb1354@uxf.cso.uiuc.edu (10/14/88)

/* Written 11:58 am  Oct 12, 1988 by casseres@Apple.COM in uxf.cso.uiuc.edu:comp.sys.mac.programmer */
In article <1234600013@uxf.cso.uiuc.edu> emb1354@uxf.cso.uiuc.edu writes:

>...  After opening a printer GrafPort, which BTW was a
>real CGrafPort, and trying to use palettes, all I could get was black.

Unless I am misreading this, there is still some confusion about printer
grafPorts.  The port is ALWAYS opened by the printer driver,...
/* End of text from uxf.cso.uiuc.edu:comp.sys.mac.programmer */

I think you may be misreading this.  Although the printer driver does open
the GrafPort, it is still possible for a CGrafPort to be initialized by the
printer driver.  The Tektronix 4692D (I hope that's the right model number)
does this.  The comment meant that I checked the version of the GrafPort and
confirmed that it was indeed a CGrafPort and not the old-style one.


*****************************************************************
*  Eric M. Berdahl            *  "Y'know, there's alot of air"  *
*  PsiWare Software, not inc. *       -Robert Miller            *
*  emb1354@uxf.cso.uiuc.edu   *                                 *
*****************************************************************