Sample app for RECT functions

Riffing on Raymond Chen’s post today about SubtractRect I threw together a toy app which demonstrates three rectangle functions: UnionRect, IntersectRect, and SubtractRect.

Usage:

>rects.exe
rects.exe
union     (left1 top1 right1 bottom1) (left2 top2 right2 bottom2) |
intersect (left1 top1 right1 bottom1) (left2 top2 right2 bottom2) |
subtract  (left1 top1 right1 bottom1) (left2 top2 right2 bottom2)

Sample output:

>rects.exe union (2 2 6 6) (4 4 8 8)
(left = 2; top = 2; right = 6; bottom = 6)
union (left = 4; top = 4; right = 8; bottom = 8)
= (left = 2; top = 2; right = 8; bottom = 8)

Source and binaries (amd64 and x86) attached.

Still no pictures though.

Exercise: implement BOOL SymmetricDifferenceRect(_Out_ RECT *C, const RECT *A, const RECT *B).

Browse source

Download rects.exe

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s