Convert Rect to C++