[comp.sys.mac.programmer] Color Quickdraw

sho@tybalt.caltech.edu (Sho Kuwamoto) (02/23/88)

I've been delinquent in getting my copy of IM V, and so have no concept
of Color Quickdraw except what I've culled from the LSC .h files and
from MacTutor.  Just warning you.

A friend of mine wants to use a Mac II for vision research, and needs
to:
	1) Blank out the entire screen and draw stuff on it
	2) Change their colors

I figured out how to get rid of the menu bar by altering the GrayRgn
thanks to a helpful article a while back.  However, I'm not at all
sure about number 2.  I'm hoping that it's a simple matter to
circumvent the "finding the closest color" deal.  It would be nice to
be able to set the PenPixPat to color number 2 no matter what that
color happens to be, and then alter the CLUT for that color later.

BTW, I asked about hiearchical menus a while back and got a lot of
responses.  I've been very busy recently, (and didn't get around to
answering everybody) so I'd like to thank everybody who sent me
something.

					-Sho



SonicYouthREMBeatlesKateBushReplacementsResidentsHuskerDuSeveredHeadsArtOfNoise
ChrisAndCoseyJoyDivisionKillingJokeLaurieAndersonWireLouReedSkinnyPuppyBrianEno

 (sho@tybalt.caltech.edu, sho@caltech.bitnet, ...!cit-vax!tybalt!sho)

rln@metasoft.UUCP (Roberta Norin) (08/17/90)

I am having two problems using Color QuickDraw and would appreciate any
advice or insights.

1.  I am converting PICTs to my application's objects: I am using the
QuickDraw standard procs to do this. For bitmaps, I just want to
create another picture so I am opening a picture and calling CopyBits
with the arguments that are passed to StdBits. I copy to the BitMap of
the current grafport. This works fine for black and white bitmaps but
I crash with color. Can anyone help. I have seen other references to
this problem but no solutions. I've tried it with some pretty small
images and still crash.

2.  I have a palette of different colors to choose from. Since there
is only one palette in the application I use the Ghost Window global
to get it to float.  This has worked fine with a small amount of extra
code except the palette manager does not change its colors when the
ColorPicker is called and a palette entry is changed. I suspect it has
something to do with the fact that it is a ghost window and am
wondering if this is an impossible combination or if there is some way
to get this to work. If I change the color entries myself by calling
PaletteToCTab(), the colors will change but only after calling the
ColorPicker a second time.

By the way I've heard that System 7.0 has floating palettes; is this true?

Thanks in advance.

Roberta Norin
rln%metasoft@bbn.com
Meta Software

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

In article <1755@metasoft.UUCP> rln@metasoft.UUCP (Roberta Norin) writes:
>I am having two problems using Color QuickDraw and would appreciate any
>advice or insights.
>
>1.  I am converting PICTs to my application's objects: I am using the
>QuickDraw standard procs to do this. For bitmaps, I just want to
>create another picture so I am opening a picture and calling CopyBits
>with the arguments that are passed to StdBits. I copy to the BitMap of
>the current grafport. This works fine for black and white bitmaps but
>I crash with color. Can anyone help. I have seen other references to
>this problem but no solutions. I've tried it with some pretty small
>images and still crash.

Something seems fishy here-- doesn't CopyBits call StdBits, and wouldn't
that make the whole thing circular?
>
>2.  I have a palette of different colors to choose from. Since there
>is only one palette in the application I use the Ghost Window global
>to get it to float.  This has worked fine with a small amount of extra
>code except the palette manager does not change its colors when the
>ColorPicker is called and a palette entry is changed. I suspect it has
>something to do with the fact that it is a ghost window and am
>wondering if this is an impossible combination or if there is some way
>to get this to work. If I change the color entries myself by calling
>PaletteToCTab(), the colors will change but only after calling the
>ColorPicker a second time.

When you change a palette entry, you need to call ActivatePalette on the
window that has that palette assigned.

--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
][, ][+, ///, ///+, //e, //c, IIGS, //c+ --- Any questions?