void CGDIplus2Dlg::OnDrawCurve()
{
CClientDC dc(this);
HDC hdc=dc.m_hDC;
Graphics myGraphics(hdc);
Point myPointArray[] =
{Point(0, 0), Point(50, 30), Point(30, 60)};
Pen myPen(Color(255,0,0,255),2);
myGraphics.DrawCurve(&myPen, myPointArray, 3, 1.5f);
}
void CGDIplus2Dlg::OnDrawBezier()
{
CClientDC dc(this);
HDC hdc=dc.m_hDC;
Graphics myGraphics(hdc);
Pen myPen(Color(255,255,0,0),1);
myGraphics.DrawBezier(&myPen, 0, 0, 40, 20, 80, 150, 100, 10);
{
Graphics* myGraphics;
HDC hdc=::GetDC(this->m_StaticWindow.m_hWnd);
myGraphics=new Graphics(hdc);
Point myPointArray[] =
{Point(0, 0), Point(40, 20), Point(80, 150), Point(100, 10)};
Pen myPen(Color(255,0,255,0),1);
myGraphics->DrawPolygon(&myPen, myPointArray, 4);
delete myGraphics;
::ReleaseDC(this->m_StaticWindow.m_hWnd,hdc);
}
}