如图,把图片边缘慢慢渐变成白色
解决方案 »
- huffman 编码成一系列01代码后再怎么来压缩成无法识别的txt文档?
- 关于CS程序的更新问题
- 在网上找一段读TXT文件的代码,有一处不明白,请高手解答
- 急救 dataGridView 绑定到数据库里的某个表, 其中有一列是ComboBox 列 源码~~~~~~~~~~~~~~~~~~急!
- 请问WinForm中,怎样才能不显示窗口的标题栏
- 正则表达式(不用正则表达式也可以)问题,高手进来看看100送上
- treeview 和 Sql Server数据库
- 这个XML和数据集互相转换的问题?顶者有分!
- 把电子琴接在电脑的声卡上(没有MIDI),如果用C#来识别弹的键是什么?
- 在引用AxAcroPDFLib的时候报错,FileLoad是否缺少 using 指令或程序集引用?
- 跪求关于c#调用MATLAB编译成的动态链接库问题
- 求助:有一个ArrayList,怎样才能把里面所有的内容一一列在textbox里呢?
#你的id{display:block; background-color:#666; height:20px; filter: alpha(opacity=90,finishopacity=0,style=1,startx=0,starty=0,finishx=0,finishy=200); }看看这个是不是你要的
{
//绘画一个四边形
PointF[] _pointfs = new PointF[4]; _pointfs[0] = new PointF(100, 50);
_pointfs[1] = new PointF(50, 80);
_pointfs[2] = new PointF(200, 80);
_pointfs[3] = new PointF(150, 50); g.DrawPolygon(Pens.Black, _pointfs); //设置Rectangle
Rectangle _rect = new Rectangle(50, 50, 150, 30);
LinearGradientBrush _linearGradientBrush = new LinearGradientBrush(
_rect, Color.Red, Color.White, LinearGradientMode.Horizontal); //定义用于在多色渐变中以内插值取代颜色混合的颜色和位置的数组
ColorBlend _colorBlend = new ColorBlend();
//定义多种颜色
_colorBlend.Colors = new Color[]
{Color.AliceBlue, Color.AntiqueWhite, Color.Aqua,
Color.Aquamarine, Color.Azure,Color.Beige};
_colorBlend.Positions = new float[] {
0/5f,1 / 5f, 2 / 5f, 3 / 5f, 4 / 5f, 5 / 5f
};
//设置多色渐变颜色
_linearGradientBrush.InterpolationColors = _colorBlend; //填充多边形
g.FillPolygon(_linearGradientBrush, _pointfs);
_linearGradientBrush.Dispose();
}
方法二:利用Timer定时控制窗体的透明度达到渐变
{
//绘画一个四边形
PointF[] _pointfs = new PointF[4]; _pointfs[0] = new PointF(100, 50);
_pointfs[1] = new PointF(50, 80);
_pointfs[2] = new PointF(200, 80);
_pointfs[3] = new PointF(150, 50); g.DrawPolygon(Pens.Black, _pointfs); //设置Rectangle
Rectangle _rect = new Rectangle(50, 50, 150, 30);
LinearGradientBrush _linearGradientBrush = new LinearGradientBrush(
_rect, Color.Red, Color.White, LinearGradientMode.Horizontal); //定义用于在多色渐变中以内插值取代颜色混合的颜色和位置的数组
ColorBlend _colorBlend = new ColorBlend();
//定义多种颜色
_colorBlend.Colors = new Color[]
{Color.AliceBlue, Color.AntiqueWhite, Color.Aqua,
Color.Aquamarine, Color.Azure,Color.Beige};
_colorBlend.Positions = new float[] {
0/5f,1 / 5f, 2 / 5f, 3 / 5f, 4 / 5f, 5 / 5f
};
//设置多色渐变颜色
_linearGradientBrush.InterpolationColors = _colorBlend; //填充多边形
g.FillPolygon(_linearGradientBrush, _pointfs);
_linearGradientBrush.Dispose();
}
加上命名空间