¿Cómo borro un objetivo de renderizado de Direct2D para que sea completamente transparente?
Estoy tratando dedibujar rectángulos semitransparentes en un HWND invisible. Sin embargo, limpiar la ventana con ID2D1HwndRenderTarget :: Clear solo hace que toda la ventana sea negra, por lo que cuando dibujo rectángulos en la parte superior, se ven semi negros.
Si no borro () y no dibujo, entonces la ventana es invisible, como debería ser. Clear () es el culpable aquí; sin embargo, si no lo uso, la pintura se desordenó bastante.
Aquí está el código que estoy usando en mi WindowProc:
case WM_PAINT:
// Begin drawing
pRenderTarget->BeginDraw();
pRenderTarget->SetTransform(D2D1::Matrix3x2F::Identity());
// Clear the window
pRenderTarget->Clear();
// Paint the panel and its children
D2DSurface()->StartPainting();
{
D2DSurface()->PaintTraverse(panel);
}
D2DSurface()->FinishPainting();
// Finish drawing
HRESULT hr = plat->pRenderTarget->EndDraw();
¡Gracias por adelantado!