#includeint main() { BRect myRect(0, 0, 300, 200); // Define a rectangle BPoint pt(myRect.RightTop()); // Get the right top coordinates printf("RightTop point: (%.0f, %.0f)\n", pt.x, pt.y); return 0; }
#includeThis example creates a BRect object with the specified values for left, top, right, and bottom edges, then moves the rectangle 50 units to the right and bottom using the OffsetBy method. Finally, the new right and top coordinates are obtained using the RightTop method and displayed. Package/Library: The BRect class and related methods are part of the Interface Kit (libbe.so) package/library in BeOS/Haiku Operating System's C++ library.int main() { BRect myRect(0, 0, 300, 200); // Define a rectangle myRect.OffsetBy(50, 50); // Move the rectangle 50 units to the right and bottom BPoint newRightTop(myRect.RightTop()); // Get the new right top coordinates printf("RightTop point: (%.0f, %.0f)\n", newRightTop.x, newRightTop.y); return 0; }