how to fill gradient for roundrect in pure gdi (not gdi+)
问题 just in pure gdi. thoughts or code are all welcome. 回答1: Create a rounded rect as a path, select the path as the clipping path, then do a gradient fill of the same rectangle. Code with MFC would look like this: int top = 10; int left = 10; int right = 200; int bottom = 200; int radius = 20; pDC->BeginPath(); pDC->RoundRect(left, top, right, bottom, radius, radius); pDC->EndPath(); pDC->SelectClipPath(RGN_COPY); TRIVERTEX vertices[2]; vertices[0].x = left; vertices[0].y = top; vertices[0].Red