首页 > 代码库 > 双缓冲技术
双缓冲技术
#ifndef _DRAW2D_H#define _DRAW2D_H#include <gdiplus.h>#pragma comment(lib, "gdiplus")using namespace Gdiplus;HWND Draw2D_hwnd;void Draw2D(PVOID pvoid){ Sleep(1); ULONG_PTR gdipludToken; GdiplusStartupInput gdiplusInput; GdiplusStartup(&gdipludToken, &gdiplusInput, NULL); RECT rect; HDC hdc = GetDC(Draw2D_hwnd); GetClientRect(Draw2D_hwnd, &rect); Bitmap bmp(rect.right, rect.bottom); SolidBrush brush(Color(255, 255, 255)); Graphics gbmp(&bmp); Graphics graphics(hdc); while (1) { gbmp.FillRectangle(&brush, 0, 0, rect.right, rect.bottom); Image min_normal(TEXT("background.png")); gbmp.DrawImage(&min_normal, 0, 0, min_normal.GetWidth(), min_normal.GetHeight()); graphics.DrawImage(&bmp, 0, 0, rect.right, rect.bottom); } ReleaseDC(Draw2D_hwnd, hdc); GdiplusShutdown(gdipludToken);}#endif
双缓冲技术
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。