Пример #1
0
 private void selectClipMethods(int mcutlineType)
 {
     this.Refresh();
     hdc = useApi.GetDC(hwnd);
     for (int i = 0; i < storeLines.Count; i++)
     {
         List <Point> points = new List <Point>();
         points.Add(storeLines[i].firstPoint);
         points.Add(storeLines[i].lastPoint);
         points.Add(lineClipRegionPoints[0]);
         points.Add(lineClipRegionPoints[1]);
         if (mcutlineType == 4)
         {
             LineCut.liangyoudongBarsky(hdc, points, Color.Blue);
         }
         else if (mcutlineType == 5)
         {
             LineCut.midSeparate(hdc, points, Color.Blue);
         }
         else if (mcutlineType == 6)
         {
         }
         else if (mcutlineType == 7)
         {
             LineCut.slopeCut(hdc, points, Color.Blue);
         }
     }
     storeLines           = new List <StoreLine>();
     lineClipRegionPoints = new List <Point>();
     useApi.ReleaseDC(hwnd, hdc);
 }
Пример #2
0
 private void CohenSutherlandToolStripMenuItem_Click(object sender, EventArgs e)
 {
     mCutLineType = 3;
     this.Refresh();
     hdc = useApi.GetDC(hwnd);
     for (int i = 0; i < storeLines.Count; i++)
     {
         LineCut.cohenSutherland(hdc, storeLines[i].firstPoint, storeLines[i].lastPoint, lineClipRegionPoints[0], lineClipRegionPoints[1], Color.Blue);
     }
     storeLines           = new List <StoreLine>();
     lineClipRegionPoints = new List <Point>();
     useApi.ReleaseDC(hwnd, hdc);
 }