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;
CWnd* CWindow=this->GetDlgItem(IDC_STA_WIN);
HWND hWnd=CWindow->m_hWnd;
CClientDC dc(&this->m_StaticWindow);//CWindow);
HDC hdc=::GetDC(hWnd);//this->m_StaticWindow.m_hWnd);
myGraphics=new Graphics(dc.m_hDC); //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);
}
}
CClientDC dc(&this->m_StaticWindow)
最新推荐文章于 2023-05-19 20:37:36 发布