C ++ / CLI Graphics-> DrawArc(DrawLine)循环清除

时间:2012-10-16 19:39:34

标签: winforms graphics c++-cli drawing

问题:我有CircleSegment的集合,当我试图在PictureBox中绘制它们时,我只从pictureBox上的集合中收到最后一个CircleSegment。为什么呢?

ref class CircleSegment 
    {
    public:
        array<double>^ massive;
        Pen^ Blackpen;
        int index;
         CircleSegment^ SegmentCircleCollection::operator [] ( const int a ) 
     { 
         return this->Alfa[a];
     }
    ....
    }


ref class SegmentCircleCollection
{
    public:
    Generic::List<CircleSegment^> ^Alfa;
...
}


private: System::Void pictureBox1_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) 
 {   
   //Where SegmentCircleCollection^ myCollection;
   for each(CircleSegment^ Selected in myCollection->Alfa)
       {
           e->Graphics->DrawLine(Selected->Blackpen,(int)Selected->massive[6],(int)Selected->massive[7],(int)Selected->massive[8],(int)Selected->massive[9]);
            e->Graphics->DrawArc(Selected->Blackpen,(int)Selected->massive[0],(int)Selected->massive[1],(int)Selected->massive[2],(int)Selected->massive[3],(int)Selected->massive[4],(int)Selected->massive[5]);
       }

...

}

0 个答案:

没有答案