CRect CopyRect is a function from MFC (Microsoft Foundation Class) library that is used to copy one rectangle to another.
Here is the syntax for using this function:
void CopyRect( LPCRECT lpSrcRect );
Example 1: Assume you have two CRect objects, r1 and r2, and you want to copy the rectangle from r1 to r2. You can use the CopyRect function as shown below:
In this example, the rectangle defined by r1 is copied to r2 using the CopyRect function.
Example 2: Assume you have an MFC CWnd-derived class named CMyWnd and you want to copy the rectangle of the window client area to another CRect object. You can use the GetClientRect and CopyRect functions as shown below:
In this example, the rectangle of the client area of the window is retrieved using the GetClientRect function and then copied to the CRect object r2 using the CopyRect function.
Package library: MFC (Microsoft Foundation Class) library.
C++ (Cpp) CRect::CopyRect - 30 examples found. These are the top rated real world C++ (Cpp) examples of CRect::CopyRect extracted from open source projects. You can rate examples to help us improve the quality of examples.