0

G'day all,

I need to provide implementation of a function declared as:

DrawGradientBitmap(CDC *pDC, COLORREF col1, COLORREF col2);

which should produce a gradient bitmap looking something like:

gradient

where col1 is the color in the center of drawing and col2 is the color in the corners, using only plain GDI in C++ MFC.

I've studied about bitmaps and all the essential GDI objects, but I can't get a clue where to start with this one. I'm not looking for code samples (not that I would mind any), but only a tips on how to draw something like this, a general approach.

Thank you.

1atera1usz
  • 133
  • 1
  • 15
  • 1
    The image looks to me like a 2D gaussian curve centered at the middle of the rectangle.. A non-efficent way to render it is to evaluate it at every pixel. – odedsh Aug 09 '14 at 14:54
  • http://stackoverflow.com/questions/2596485/how-to-fill-gradient-for-roundrect-in-pure-gdi-not-gdi MSDN: http://msdn.microsoft.com/en-us/library/dd144957%28v=vs.85%29.aspx – firda Aug 09 '14 at 14:57

0 Answers0