繪製顯示環境
[與此頁面相關聯的功能,DrawDib是舊版功能。 MediaComposition 類別已取代它。 MediaComposition 類別 已針對 Windows 10 和 Windows 11 優化。 Microsoft強烈建議新程式代碼盡可能使用 MediaComposition 類別,而不是 DrawDib。 Microsoft建議使用舊版 API 的現有程式代碼,盡可能改寫成使用新的 API。]
下列範例會先使用 drawDibRealize 函式來準備 DrawDib DC,然後再以位圖序列顯示數個影像。
hdc = GetDC(hwnd);
DrawDibBegin(hdd, hdc, dxDest, dyDest, lpbi, dxSrc, dySrc, NULL);
DrawDibRealize(hdd, hdc, fBackground);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
DrawDibDraw(hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits,
xSrc, ySrc, dxSrc, dySrc, DDF_SAME_DRAW|DDF_SAME_HDC);
ReleaseDC(hwnd, hdc);
相關主題