如图,把图片边缘慢慢渐变成白色

解决方案 »

  1.   


    #你的id{display:block; background-color:#666; height:20px; filter: alpha(opacity=90,finishopacity=0,style=1,startx=0,starty=0,finishx=0,finishy=200); }看看这个是不是你要的
      

  2.   

    这个..看不太懂,我问的Winform的
      

  3.   

    方法一:直接绘画所需要的四边形:private void DrawColorPolygon(Graphics g)
            {
                //绘画一个四边形
                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定时控制窗体的透明度达到渐变
      

  4.   

    private void DrawColorPolygon(Graphics g)
            {
                //绘画一个四边形
                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();
            }
    加上命名空间