摘要: MFC GDI+ 绘图——————————————————————————void CGDIplusTestView::OnDraw(CDC* /*pDC*/) { CGDIplusTestDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; // TODO: 在此处为本机数据添加绘制代码 CDC* pDC = GetDC(); Graphics GDIplusObj(pDC->m_hDC); CRect rt; GetClientRect(&rt); //绘制灰底 SolidBrush brush(C 阅读全文
posted @ 2011-04-25 09:28 Watson.Long 阅读(3799) 评论(0) 推荐(0) 编辑
摘要: Visual Studio 2008中使用GDI+——————————————————————————1.在stdafx.h文件中加入以下几句话:#include <afxdtctl.h>#include <gdiplus.h> //将GDI+头文件加入到工程中#pragma comment(lib, "gdiplus.lib") //将GDI+的lib文件加入到工程中using namespace Gdiplus; //使用GDI+的命名空间2.假设工程名叫abc,则在自动生成的abc.h文件中添加成员变量:protected:GdiplusSta 阅读全文
posted @ 2011-04-25 09:10 Watson.Long 阅读(768) 评论(0) 推荐(0) 编辑
摘要: GDI+使用双缓冲绘图————————————————————————我再来详细解释一下刚才实现双缓冲的具体步骤:1、在内存中建立一块“虚拟画布”:Bitmap bmp = new Bitmap(600, 600);2、获取这块内存画布的Graphics引用:Graphics g = Graphics.FromImage(bmp);3、在这块内存画布上绘图:g.FillEllipse(brush, i * 10, j * 10, 10, 10);4、将内存画布画到窗口中this.CreateGraphics().DrawImage(bmp, 0, 0);==================== 阅读全文
posted @ 2011-04-25 09:09 Watson.Long 阅读(9887) 评论(3) 推荐(0) 编辑