Exemplo n.º 1
0
 private static void CopyPngToBuilder(Png png, PngBuilder builder)
 {
     for (int y = 0; y < png.Height; y++)
     {
         for (int x = 0; x < png.Width; x++)
         {
             var pixel = png.GetPixel(x, y);
             builder.SetPixel(pixel, x, y);
         }
     }
 }
Exemplo n.º 2
0
 public override void Init(MemoryStream imageStream)
 {
     this.imageStream = imageStream;
     readOnlyInstance = Png.Open(this.imageStream);
     writableInstance = PngBuilder.Create(readOnlyInstance.Width, readOnlyInstance.Height, readOnlyInstance.HasAlphaChannel);
     for (var y = 0; y < readOnlyInstance.Height; y++)
     {
         for (var x = 0; x < readOnlyInstance.Width; x++)
         {
             writableInstance.SetPixel(readOnlyInstance.GetPixel(x, y), x, y);
         }
     }
 }
Exemplo n.º 3
0
 public override void SetPixel(int x, int y, Color color)
 {
     writableInstance.SetPixel(new Pixel((byte)color.R, (byte)color.G, (byte)color.B, (byte)color.A, false), x, y);
 }