Пример #1
0
        public static string ToSVG(this Wg.ShadowEffect input)
        {
            double radians = (input.Angle + 180) / 180 * Math.PI;
            string output  = "<feDropShadow dx=\"" + Math.Round(input.Distance * Math.Sin(radians), 4) + "\" dy=\"" + Math.Round(input.Distance * Math.Cos(radians), 4) + "\" stdDeviation=\"" + input.Radius + "\" flood-color=\"" + input.Color.ToSVG() + "\" flood-opacity=\"" + Math.Round(input.Color.A / 255.0, 4) + "\" />" + Environment.NewLine;

            return(output);
        }
Пример #2
0
 public ShadowEffect(ShadowEffect shadowEffect)
 {
     this.Color    = shadowEffect.Color;
     this.Radius   = shadowEffect.Radius;
     this.Angle    = shadowEffect.Angle;
     this.Distance = shadowEffect.Distance;
 }
Пример #3
0
        public static Se.DropShadowEffect ToMediaEffect(this Wg.ShadowEffect input)
        {
            Se.DropShadowEffect output = new Se.DropShadowEffect();
            output.BlurRadius  = input.Radius;
            output.Direction   = input.Angle + 90;
            output.ShadowDepth = input.Distance;

            return(output);
        }
Пример #4
0
 public Effects(Effects effects)
 {
     id = Guid.NewGuid().ToString();
     this.hasEffects = effects.hasEffects;
     this.hasBlur    = effects.hasBlur;
     this.blur       = effects.blur;
     this.hasShadow  = effects.hasShadow;
     this.shadow     = effects.shadow;
 }
Пример #5
0
        public static Se.DropShadowBitmapEffect ToMediaBitmapEffect(this Wg.ShadowEffect input)
        {
            Se.DropShadowBitmapEffect output = new Se.DropShadowBitmapEffect();
            output.Color       = input.Color.ToMediaColor();
            output.Opacity     = input.Color.A / 255.0;
            output.Softness    = input.Radius;
            output.Direction   = input.Angle;
            output.ShadowDepth = input.Distance;

            return(output);
        }
Пример #6
0
 protected Effects(ShadowEffect shadowEffect)
 {
     id = Guid.NewGuid().ToString();
     this.hasEffects = true;
     this.shadow     = new ShadowEffect(shadowEffect);
 }