RectangleF::Equality Operator (RectangleF, RectangleF)
.NET Framework (current version)
Tests whether two RectangleF structures have equal location and size.
Assembly: System.Drawing (in System.Drawing.dll)
Parameters
- left
-
Type:
System.Drawing::RectangleF
The RectangleF structure that is to the left of the equality operator.
- right
-
Type:
System.Drawing::RectangleF
The RectangleF structure that is to the right of the equality operator.
Return Value
Type: System::BooleanThis operator returns true if the two specified RectangleF structures have equal X, Y, Width, and Height properties.
The following code example demonstrates how to use the Implicit(Rectangle to RectangleF), RectangleFand Equality members. This example is designed for use with a Windows Form. Paste this code into a form and call the ConvertRectangleToRectangleF method when handling the form's Paint event, passing e as PaintEventArgs.
private: void ConvertRectangleToRectangleF( PaintEventArgs^ e ) { // Create a rectangle. Rectangle rectangle1 = Rectangle(30,40,50,100); // Convert it to a RectangleF. RectangleF convertedRectangle = rectangle1; // Create a new RectangleF. RectangleF rectangle2 = RectangleF(PointF(30.0F,40.0F),SizeF(50.0F,100.0F)); // Create a custom, partially transparent brush. SolidBrush^ redBrush = gcnew SolidBrush( Color::FromArgb( 40, Color::Red ) ); // Compare the converted rectangle with the new one. If they // are equal draw and fill the rectangles on the form. if ( convertedRectangle == rectangle2 ) { e->Graphics->FillRectangle( redBrush, rectangle2 ); } // Dispose of the custom brush. delete redBrush; } };
.NET Framework
Available since 1.1
Available since 1.1
Show: