我现有的代码在箭头线下绘制了固定的“阴影”颜色。但是从我的角度来看,这是很紧急的。我需要一个更好的真实阴影w /位移(水平和垂直),不透明度和模糊自定义参数。如何在C#中实现这种漂亮的阴影效果?
using (GraphicsPath _Path = new GraphicsPath())
{
_Path.AddLine(mouseDownX, mouseDownY, mouseUpdX, mouseUpY);
// Draw the shadow.
mygraphics.TranslateTransform(3, 3); //displacement
using (Pen _Pen = new Pen(Color.FromArgb(30, 0, 0, 0), hPen.Width))
{
_Pen.CustomStartCap = adjustableArrowCap_0;
mygraphics.DrawPath(_Pen, _Path);
}
mygraphics.ResetTransform();
}
mygraphics.DrawLine(hPen, mouseDownX, mouseDownY, mouseUpdX, mouseUpY);