Gradient Brush in Native C++?
问题 In c#, you can use drawing2d.lineargradientbrush, but in c++ right now I only found the CreateSolidBrush function. Is there a function in the native gdi dll to create a gradient brush? I couldn't find anything like this at msdn. Thanks 回答1: To draw a vertical gradient: void VerticalGradient(HDC hDC, const RECT& GradientFill, COLORREF rgbTop, COLORREF rgbBottom) { GRADIENT_RECT gradientRect = { 0, 1 }; TRIVERTEX triVertext[ 2 ] = { GradientFill.left - 1, GradientFill.top - 1, GetRValue(rgbTop)