Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!microsoft!t-stephp From: t-stephp@microsoft.UUCP (Stephen Poole) Newsgroups: comp.sys.mac.programmer Subject: Palette question Message-ID: <26@microsoft.UUCP> Date: 30 Jan 89 17:26:04 GMT Reply-To: t-stephp@microsoft.UUCP (Stephen Poole) Distribution: usa Organization: Microsoft Corp., Redmond WA Lines: 44 Hello, folks. I've been playing around with LSC 3.01 (and enjoying it greatly) and recently started messing with pixel patterns. I haven't been able to produce a pixel pattern that actually uses RGB colors. What I've done is createD a color window with NewCWindow, which works fine as far as I can tell, and then attempt to fill a rect with my pixpat. The pixpat is created with MakeRGBPat; I've tried a variety of RGB colors as the pattern specifier. FillCRect, when given this pattern, fills my rect with a pattern using only QuickDraw colors. I've also tried using PmForeColor with an index from 0 to 255 and painting an oval; this invariably gives me black. Soooo, do I somehow need to attach or specify a palette for use by my CWindow? Is there a good source for example Color QuickDraw code? A fragment of my program: void doabout() { PixPatHandle niftypattern; RGBColor niftycolor; CWindowPtr niftywindow; Rect niftywinrect; /* set up rect "niftywinrect" here */ /* build a sample RGB color in "niftycolor" here */ niftypattern = NewPixPat(); MakeRGBPat(niftypattern, &niftycolor); niftywindow = (CWindowPtr) NewCWindow(NULL, &niftywinrect, "\pNifty Window", TRUE, 4, (int *) -1, FALSE, 0); FillCRect(&niftywinrect, niftypattern); } And another question... LSC didn't know about the CWindowPtr type, even though I was including both Color.h and ColorToolbox.h. I typedef'ed CWindowPtr to be CGrafPtr. Is this a problem? Should I be including something else (MacHeaders are enabled)? Thanks for any help you can provide. -- -- Stephen D. Poole -- t-stephp@microsoft.UUCP -- Mac II Fanatic -- -- -- -- I'm just an Oregon Tech Software Engineering co-op at Micro- -- -- soft. Believe me, nobody here pays attention to my opinions! --