[comp.sys.mac.programmer] PaintRect

time@tbomb.ice.com (Tim Endres) (09/07/90)

I am using MPW to develop an application. In that application, I am
using controls (custom built) that use PICT's. For some reason, which
I can not understand, the following code perfectly "dims" the controls
on any machine except a MacPlus. Anyone possibly know why?

	LoadResource((Handle)picture);
	DrawPicture(picture, &pict_list->bounds);
	if (pict_list->active == 0) {		/* I.e. it is dim. */
		PenMode(srcBic);
		PenPat(qd.gray);
		PaintRect(&pict_list->bounds);
		PenNormal();
		}

In fact, instead of the "dim" affect caused by the gray pattern putting
holes in the picture, is appears that a black pattern is actually
used, since the picture simply disappears (white-ed out).

tim.

-------------------------------------------------------------
Tim Endres                |  time@ice.com
ICE Engineering           |  uunet!ice.com!time
8840 Main Street          |
Whitmore Lake MI. 48189   |
--- Disclaimed.

russotto@eng.umd.edu (Matthew T. Russotto) (09/08/90)

In article <b.P01A0N@tbomb.ice.com> time@tbomb.ice.com writes:
>
>I am using MPW to develop an application. In that application, I am
>using controls (custom built) that use PICT's. For some reason, which
>I can not understand, the following code perfectly "dims" the controls
>on any machine except a MacPlus. Anyone possibly know why?

>		PenMode(srcBic);
ALERT! ALERT!  'src' modes should only be used for CopyBits and that sort of
thing-- for pen and line drawing use the 'pat' modes.
		PenMode(patBic);
(This restriction was removed in the Mac SE)