0

问题:我有 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]);
       }

...

}

4

0 回答 0