System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(10, 20, 50, 30); RECT rect = RECT.FromRectangle(rectangle);
System.Windows.Rect windowRect = new System.Windows.Rect(0, 0, 800, 600); RECT rect = RECT.FromRectangle(windowRect);In this example, we create a new System.Windows.Rect object with dimensions of x=0, y=0, width=800, and height=600. We then use the FromRectangle method to create a RECT object from the rectangle. The resulting RECT object will have the same dimensions. Package library: It is part of the Windows library and can be found in the user32.dll file.