![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MFC
qq_45693271
这个作者很懒,什么都没留下…
展开
-
小球做平抛运动下落
void paintBall(int x,int y,int r,CDC *pDC){ int R=0,G=0,B=0; double w,d; w=r;d=w/255; for(; w>=0; w-=d) { CPen p; p.CreatePen(1,1,RGB(R,G,B)); pDC->SelectObject(&p); pDC->Ellipse(x-w,y-w,x+w,y+w); R+=10;G+=10;B+=10;原创 2021-04-25 15:13:58 · 158 阅读 · 0 评论 -
MFC 画出钟的外形
void CMy2View::OnDraw(CDC* pDC){ CMy2Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); char s[12] = {6,5,4,3,2,1,12,11,10,9,8,7}; int n,x, y; double i; n=0; CString c; for(i=0; i<576; i+=52.3) { c.Format("%d",s[n]); x = int(200 + 200 * sin(i/原创 2021-04-25 15:11:02 · 89 阅读 · 0 评论 -
通过四个控制点绘制三次贝赛尔曲线
CPoint points[4];int count=0;void CMyView::OnDraw(CDC* pDC){ CMyDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); int q,w,xx1,yy1, xx2,yy2; for(float t=0; t<1; t+=0.001) { xx1 = (1-t) * (1-t) * points[0].x + 2 * t * (1-t) * points[1].x + t * t *.原创 2021-04-19 10:43:16 · 1333 阅读 · 1 评论 -
填充正六边形
此示例为填充正六边形struct Edge //用来储存边的结构体{ int yUpper;; float xIntersect, dxPerScan; struct Edge * next;//指向下一条边的指针}tEdge;//结构体变量void insertEdge(Edge *list, Edge *edge){ Edge *p, *q = list;//插入边的函数 p = q ->next; while(p != NULL) { if (edge ->xI原创 2021-04-14 11:02:18 · 113 阅读 · 0 评论