Exemple #1
0
 public static Texture BlendTopDown(Texture top, Texture down)
 {
     int h = top.Height;
     int w = top.Width;
     down.Resize(w, h);
     Texture t = new Texture(w, h);
     int pos = 0x00;
     int x;
     uint alpha;
     for(int y = 0x00; y < h; y++) {
         alpha = (uint)(0xff*y/(top.Height-0x01));
         for(x = 0x00; x < top.Width; x++) {
             t.Pixel[pos] = ColorUtils.Transparency(down.Pixel[pos], top.Pixel[pos], alpha);
             pos++;
         }
     }
     return t;
 }