0
点赞
收藏
分享

微信扫一扫

CGDIplus2Dlg::OnDrawEllipse()


void CGDIplus2Dlg::OnDrawRectangle() 
{

		Pen* myPen = new Pen(Color(255, 255, 0, 0), 3);//红笔

	Graphics*    myGraphics;

	CClientDC dc(this);
	HDC hdc=dc.m_hDC;

    myGraphics = new Graphics(hdc);//Graphics就像在模仿Delphi的Canvas


myGraphics->DrawRectangle(myPen, 100, 50, 80, 40);
Rect myRect(200, 50, 80, 40);
myGraphics->DrawRectangle(myPen, myRect);


	delete myPen;

	delete myGraphics;


	
}

void CGDIplus2Dlg::OnDrawEllipse() 
{
		Pen* myPen = new Pen(Color(255, 255, 0, 0), 3);//红笔

	Graphics*    myGraphics;

	CClientDC dc(this);
	HDC hdc=dc.m_hDC;

    myGraphics = new Graphics(hdc);//Graphics就像在模仿Delphi的Canvas


//myGraphics->DrawRectangle(myPen, 100, 50, 80, 40);
myGraphics->DrawEllipse(myPen, 100, 50, 160, 80);

Pen* myPenBlue = new Pen(Color(255, 0, 0, 255), 1);//蓝笔
myGraphics->DrawArc(myPenBlue, 100, 50, 160, 80, 90, 90);

//Rect myRect(200, 50, 80, 40);
//myGraphics->DrawRectangle(myPen, myRect);

Rect myRect(100, 150, 160, 80);
myGraphics->DrawEllipse(myPen, myRect);
myGraphics->DrawRectangle(myPen, myRect);





	delete myPen;
	delete myPenBlue;
	delete myGraphics;

	
}



举报

相关推荐

2020/2/22-2

javase 2-2 类

单链表2-2

技术2---swagger2

2

0 条评论