This solution serves more code, but many times faster than GetPixel / SetPixel. It has one overload without any additional settings, or you can use it with alpha start and stop value, as well as how much you want to βcompressβ the reflection.
The overloaded simple version assumes that the background color will be the same as the parent. Please note that there is no error checking. Of course, you need to implement this in production code.
The result will be like this: (many thanks to Neolisk for surviving the additional problem of creating an image from the code)

There is still room for optimization (it works only with the "compressed" version, without boxing, etc.), but I will leave this as a performance for the user :-)
Private Sub DrawControlReflection(c As Control) DrawControlReflection(c, c.Parent.BackColor, 1, 0, 1, 7) 'set you defaults here End Sub ''' <summary> ''' Draws an reflection of a control ''' </summary> ''' <param name="c">The control to make an reflection of</param> ''' <param name="bgCol">Background color in transparent area</param> ''' <param name="startTrans">0.0-1.0, start value of reflection transparency, usually 1</param> ''' <param name="endTrans">0.0-1.0, end value of reflection transparency, usually 0</param> ''' <param name="squeeze">height of reflection, values 0-1, 1=100%, 0.5=50% etc.</param> ''' <param name="delta">y offset of reflection from control bottom</param> ''' <remarks> ''' Provided AS-IS. ''' Created by Epistmex, use as you want. ''' Need implementation of error checking (bitmap allocations etc.) ''' </remarks> Private Sub DrawControlReflection(c As Control, bgCol As Color, startTrans As Single, endTrans As Single, squeeze As Single, delta As Integer) ' '
source share