InvertCorners_VintageMacintosh/invertcorners.c
2021-12-28 21:00:31 +00:00

1 line
643 B
C

#include <Quickdraw.h>
int main(void)
{
// Setup
Rect s;
RgnHandle CornersRgn;
RgnHandle WholeRgn;
InitGraf(&qd.thePort);
InitWindows();
s = qd.screenBits.bounds;
// Whole screen set
RectRgn(qd.thePort->visRgn, &s);
// Draw the rounded corners
WholeRgn = NewRgn();
OpenRgn();
FrameRoundRect(&s, 16, 16);
CloseRgn(WholeRgn);
// Invert just the corners
CornersRgn = NewRgn();
DiffRgn(qd.thePort->visRgn, WholeRgn, CornersRgn);
InvertRgn(CornersRgn);
// Set screen as rounded screen
CopyRgn(WholeRgn, qd.thePort->visRgn);
DisposeRgn(WholeRgn);
}