Exemplo n.º 1
0
 public void Render(WriteableBitmap input)
 {
     input.ForEach((x, y, color) =>
     {
         System.Windows.Media.Color?result = null;
         //Let's assume we start with the last layer in the collection (or the bottom most layer)
         Each <VisualLayer>(i =>
         {
             if (i is PixelLayer)
             {
                 var other = (i as PixelLayer).Pixels;
                 if (x < other.PixelWidth && y < other.PixelHeight)
                 {
                     var b = other.GetPixel(x, y);
                     if (result == null)
                     {
                         //If no color has been recorded yet, record the first layer (or the bottom most)
                         result = b;
                         return;
                     }
                     //If a color has been recorded, let's say this is the second layer; in what order are the colors blended?
                     result = VisualLayer.Blend(i.BlendMode, b, result.Value);
                 }
             }
         });
         return(result ?? color);
     });
 }
Exemplo n.º 2
0
 public ScaleTransform(VisualLayer layer) : base(layer)
 {
 }
Exemplo n.º 3
0
 public RotateTransform(VisualLayer layer) : base(layer)
 {
 }
Exemplo n.º 4
0
 public PerspectiveTransform(VisualLayer layer) : base(layer)
 {
 }
Exemplo n.º 5
0
 public DistortTransform(VisualLayer layer) : base(layer)
 {
 }
Exemplo n.º 6
0
 public Transform(VisualLayer visualLayer)
 {
     VisualLayer = visualLayer;
 }