Пример #1
0
        public static UGGradientStop[] ToUGGradientStop(this ColorBlend gdiStops)
        {
            var count   = gdiStops.Colors.Length;
            var ugStops = new UGGradientStop[count];

            for (var i = 0; i < count; ++i)
            {
                var color    = gdiStops.Colors[i];
                var position = gdiStops.Positions[i];
                ugStops[i] = new UGGradientStop(color.ToUGColor(), position);
            }
            return(ugStops);
        }
Пример #2
0
        public static UGGradientStop[] ToUGGradientStop(this GradientStopCollection wpfStops)
        {
            var count   = wpfStops.Count;
            var ugStops = new UGGradientStop[count];

            var i = 0;

            foreach (var wpfStop in wpfStops)
            {
                ugStops[i++] = new UGGradientStop(wpfStop.Color.ToUGColor(), (float)wpfStop.Offset);
            }
            return(ugStops);
        }
Пример #3
0
 private static void AddColorblend(this UGGradientStop ugStop, ref ColorBlend gdiStops, ref int outIdx, float offset)
 {
     gdiStops.Colors[outIdx]    = ugStop.Color.ToGDIColor();
     gdiStops.Positions[outIdx] = offset;
     ++outIdx;
 }