[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving a screen pixmap

To:     Mark A. Tapia     markt@dgp.toronto.edu
cc:     info-mcl
From:   Steve Mitchell
Date:   4/29/92
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.