![]() If (rectangle1.IntersectsWith(rectangle2))Į.Graphics.FillRectangle(Brushes.Green, rectangle1) Rectangle rectangle2 = new Rectangle(70, 20, 100, 200) Į.Graphics.DrawRectangle(Pens.Black, rectangle1) Į.Graphics.DrawRectangle(Pens.Red, rectangle2) Rectangle rectangle1 = new Rectangle(50, 50, 200, 100) Private void InstanceRectangleIntersection(PaintEventArgs e) If ( rectangle1.IntersectsWith( rectangle2 ) )Į->Graphics->FillRectangle( Brushes::Green, rectangle1 ) Rectangle rectangle2 = Rectangle(70,20,100,200) Į->Graphics->DrawRectangle( Pens::Black, rectangle1 ) Į->Graphics->DrawRectangle( Pens::Red, rectangle2 ) Void InstanceRectangleIntersection( PaintEventArgs^ e ) Paste this code into a form and call this method when handling the form's Paint event, passing e as PaintEventArgs. ![]() This example should be used with a Windows Form. The following code example demonstrates the how to use a member of the Brushes class to fill a Rectangle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |