[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Saving a screen pixmap
- To: MARKT@DGP.TORONTO.EDU
- Subject: Re: Saving a screen pixmap
- From: STEVE.M@AppleLink.Apple.COM (Carbon-based, S Mitchell,APD)
- Date: 30 Apr 92 07:17 GMT
- Cc: INFO-MCL@CAMBRIDGE.APPLE.COM
To: Mark A. Tapia firstname.lastname@example.org
From: Steve Mitchell
Sub: Saving a screen pixmap
> Does anyone have code that saves a snapshot of a portion
> of the color screen (e.g. the upper left rectangle from
> #@(0 0) to #@(100 100)) and that draws the snapshot in
> a color window, with the correct color table?
Warning to others: Weird things usually happen to your windows
and your Mac when you access the screen directly; don't do it
unless there is absolutely no other way.
> Whenever I try to do this, the snapshot is monochrome.
> (I use the oodles-of-utils functions to get the
> wmgrPort and use copyBits to copy the pixMap after
> focusing the view on the *wmgrView*. I've also
> tried copying the bits from the grafPort specified
> by the getMaxDevice trap call).
What you want is a picture. If you haven't already done so,
wrap OpenPicture/ClosePicture around your CopyBits (out of
the WMgrPort.) Technically you should temporarily dilate
the visRgn and clipRgn out to say +-30,000. When you want
to draw the picture in a window, DrawPicture your
picHandle in view-draw-contents.
> Similar efforts with C code have been equally unsucessful.
> Am I using the wrong color table?
What color table? CopyBits doesn't create one for you.