Esempio n. 1
0
        // THIS IS A HELPER FUNCTION FOR GetRegionData.
        public void DisplayRegionData(PaintEventArgs e,
                                      int len,
                                      System.Drawing.Drawing2D.RegionData dat)
        {
            // Display the result.
            int        i;
            float      x = 20, y = 140;
            Font       myFont  = new Font("Arial", 8);
            SolidBrush myBrush = new SolidBrush(Color.Black);

            e.Graphics.DrawString("myRegionData = ",
                                  myFont,
                                  myBrush,
                                  new PointF(x, y));
            y = 160;
            for (i = 0; i < len; i++)
            {
                if (x > 300)
                {
                    y += 20;
                    x  = 20;
                }
                e.Graphics.DrawString(dat.Data[i].ToString(),
                                      myFont,
                                      myBrush,
                                      new PointF(x, y));
                x += 30;
            }
        }
Esempio n. 2
0
        public static bool AreOverlapping(BuildingCoordinates b1, BuildingCoordinates b2, out int[] resultingBuildingProfile)
        {
            bool      isOverlapping = false;
            Rectangle r1            = GetRectangleFromBuildingCoordinate(b1);
            Rectangle r2            = GetRectangleFromBuildingCoordinate(b2);

            // Are these intersecting (overlapping)?
            Rectangle r3 = Rectangle.Intersect(r1, r2);

            isOverlapping = !r3.IsEmpty;

            Rectangle r4 = Rectangle.Union(r1, r2);


            //Create a simple region.
            Region region1 = new Region(r1);

            // Extract the region data.
            System.Drawing.Drawing2D.RegionData region1Data = region1.GetRegionData();
            byte[] data1;
            data1 = region1Data.Data;



            //var region = new Region(r1);
            //region.Exclude(r2);

            resultingBuildingProfile = null;
            return(isOverlapping);
        }
 public Region(System.Drawing.Drawing2D.RegionData rgnData)
 {
 }
Esempio n. 4
0
 private RegionData(System.Drawing.Drawing2D.RegionData regionData)
 {
     WrappedRegionData = regionData;
 }