CRect rect(10, 20, 50, 60); // create a rectangle with given coordinates rect.InflateRect(10, 10, 10, 10); // increase its size by 10 pixels on each side
CRect rect(10, 20, 50, 60); // create a rectangle with given coordinates rect.InflateRect(-20, 0, -20, 0); // decrease its size by 20 pixels on the left and right sidesIn this example, we create a CRect object with coordinates (10, 20, 50, 60) and then use the InflateRect method to decrease its size by 20 pixels on the left and right sides. The resulting rectangle will have coordinates (30, 20, 30, 60). The CRect InflateRect method is part of the MFC library in C++, specifically the CRect class that defines rectangles.