System::Void Form1_Paint(System::Object^ sender,
System::Windows::Forms::PaintEventArgs^ e)
{
Bitmap ^ bmpGraduates = gcnew Bitmap(L"graduates.bmp");
TextureBrush ^ brushGraduates = gcnew TextureBrush(bmpGraduates);
Bitmap ^ bmpUndergraduates = gcnew Bitmap(L"undergraduates.bmp");
TextureBrush ^ brushUndergraduates = gcnew TextureBrush(bmpUndergraduates);
Bitmap ^ bmpCertificates = gcnew Bitmap(L"certificates.bmp");
TextureBrush ^ brushCertificates = gcnew TextureBrush(bmpCertificates);
pbxChart->CreateGraphics()->FillPie(brushGraduates,
0.0F,
0.0F,
260.0F,
200.0F, 0.0F, Graduates);
pbxChart->CreateGraphics()->FillPie(brushUndergraduates,
0.0F,
0.0F,
260.0F,
200.0F, Graduates, Undergraduates);
pbxChart->CreateGraphics()->FillPie(brushCertificates,
0.0F,
0.0F,
260.0F,
200.0F, Graduates + Undergraduates,
Certificates);
e->Graphics->FillRectangle(brushGraduates,
Rectangle(lblGraduates->Left,
lblGraduates->Top + 18,
btnClose->Width,
20));
e->Graphics->DrawRectangle(gcnew Pen(Color::Black),
Rectangle(lblGraduates->Left-1,
lblGraduates->Top + 18,
btnClose->Width,
20));
e->Graphics->FillRectangle(brushUndergraduates,
Rectangle(btnClose->Left,
lblUndergraduates->Top + 18,
btnClose->Width,
20));
e->Graphics->DrawRectangle(gcnew Pen(Color::Black),
Rectangle(btnClose->Left-1,
lblUndergraduates->Top + 18,
btnClose->Width+1,
20));
e->Graphics->FillRectangle(brushCertificates,
Rectangle(btnClose->Left,
lblCertificates->Top + 18,
btnClose->Width,
20));
e->Graphics->DrawRectangle(gcnew Pen(Color::Black),
Rectangle(btnClose->Left-1,
lblCertificates->Top + 18,
btnClose->Width+1,
20));
pbxChart->CreateGraphics()->DrawPie(gcnew Pen(Color::Blue),
0.0F,
0.0F,
260.0F,
200.0F, 0.0F, Graduates);
pbxChart->CreateGraphics()->DrawPie(gcnew Pen(Color::Red),
0.0F,
0.0F,
260.0F,
200.0F, Graduates, Undergraduates);
pbxChart->CreateGraphics()->DrawPie(gcnew Pen(Color::Green),
0.0F,
0.0F,
260.0F,
200.0F, Graduates + Undergraduates,
Certificates);
pbxChart->CreateGraphics()->DrawEllipse(gcnew Pen(Color::Red, 2),
Rectangle(0,
0,
260,
200));
}
|