How to make a Dropshadow?
How can you make a proper dropshadow for an image? I just used a gradientbrush and filled another rectangle but that doesn't look nearly as good.
VB Code:
Public Function DropShadow(ByVal img As Image, ByVal OffSet As Integer) As Bitmap
Dim g As Graphics
Dim bmp As New Bitmap(CType(img.Width, Integer), CType(img.Height, Integer))
g = Graphics.FromImage(bmp)
Dim gb As New Drawing2D.LinearGradientBrush(New RectangleF(OffSet, OffSet, img.Width, img.Height), Color.Black, Color.White, Drawing2D.LinearGradientMode.ForwardDiagonal)
g.FillRectangle(gb, New Rectangle(OffSet, OffSet, img.Width, img.Height))
g.DrawImage(img, New Rectangle(0, 0, img.Width, img.Height), 0, 0, img.Width + OffSet, img.Height + OffSet, GraphicsUnit.Pixel)
Return bmp
End Function