GDI+,使用一个缓冲(我叫它单缓冲,不知道对不对)

    HDC hdc;//设备DC
    HDC buffhdc;//缓冲DC
    RECT g_rect;
    HBITMAP g_bkbitmap;
    GetClientRect(hWnd,&g_rect);
    hdc = GetDC(hWnd);//设备DC
    buffhdc = CreateCompatibleDC(hdc);//缓冲DC
    g_bkbitmap = CreateCompatibleBitmap(hdc,g_rect.right,g_rect.bottom);
    SelectObject(buffhdc,g_bkbitmap);
    DrawBackdrop(buffhdc);
    Drawing(buffhdc);
    BitBlt(hdc,0,0,g_rect.right,g_rect.bottom,buffhdc,0,0,SRCCOPY);
    DeleteDC(buffhdc);
    DeleteObject(g_bkbitmap);
    ReleaseDC(hWnd, hdc);

你可能感兴趣的:(GDI+,使用一个缓冲(我叫它单缓冲,不知道对不对))