In the code below, I am trying to add some kind of halo blurred effect to a rounded image.
For this, I have created in Photoshop a blurry background -> "blurredBackgroundImage", which gets drawn before the initial image (an .ico file). (the blurred picture is bigger in size than the initial image => halo effect around the initial picture). The problem arises after having overlapped the images, since now the initial image gets truncated somehow, i.d it is not perfectly round. I would appreciate any help!
private void DrawHalo(ToolStripItemImageRenderEventArgs e, Rectangle rc) { Image initialImage = e.Image; var rcBm = new Rectangle(7, 2, rc.Width, rc.Height); rcBm.Inflate(3, 3); var blurredBackgroundImage = Properties.Resources.preferences_blurredBackground;
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; e.Graphics.DrawImage(blurredBackgroundImage, rcBm); e.Graphics.DrawImage(initialImage, rc); }