c# - 在箭头线下绘制更好的阴影
问题描述
我现有的代码在箭头线下绘制了一个固定的“阴影”颜色。但在我看来,这很紧迫。我需要一个更好的真实阴影,带位移(水平和垂直),不透明度和模糊自定义参数。如何在 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);
解决方案
推荐阅读
- c - 有没有办法 malloc 数组大小为 10 的整数指针并返回其值?
- vim - 当我在 vim 中输入 '-' 字符时,它似乎正在打印回车,然后是 'm'
- python-3.x - 如何使python脚本实时更新(连续运行)
- c++ - 如何在 c++ 中排序最大值?
- python - Python-得到一个快速排序递归错误
- json - Rest 服务返回“远程服务器返回错误:(415) 不支持的媒体类型。”
- python - 在 tf 2.0 训练期间创建 tf.keras 回调以保存每个批次的模型预测和目标
- css - 如何在 style.css 文件中使用 java-script 变量
- javascript - 如何在使用 api 附加新文本之前清除 .text 或 .html
- cmd - 如何从另一个命令的输出执行 CMD 命令