コード例 #1
0
ファイル: Piece.cs プロジェクト: nelsestu/a-vnc
 public Bitmap getImg(int compressionlevel)
 {
     if (compressionlevel == 2)
     {
         OctreeQuantizer quantizer = new OctreeQuantizer(255, 8); // 255 colors, 8 bits...
         return quantizer.Quantize(img);
     }
     else if (compressionlevel == 3)
     {
         OctreeQuantizer quantizer = new OctreeQuantizer(63, 6); // 63 colors, 6 bits...
         return quantizer.Quantize(img);
     }
     else if (compressionlevel == 4)
     {
         OctreeQuantizer quantizer = new OctreeQuantizer(15, 4); // 15 colors, 4 bits (very low quality)...
         return quantizer.Quantize4bpp(img);
     }
     else
         return img;
 }
コード例 #2
0
 public Bitmap getImg(int compressionlevel)
 {
     if (compressionlevel == 2)
     {
         OctreeQuantizer quantizer = new OctreeQuantizer(255, 8); // 255 colors, 8 bits...
         return(quantizer.Quantize(img));
     }
     else if (compressionlevel == 3)
     {
         OctreeQuantizer quantizer = new OctreeQuantizer(63, 6); // 63 colors, 6 bits...
         return(quantizer.Quantize(img));
     }
     else if (compressionlevel == 4)
     {
         OctreeQuantizer quantizer = new OctreeQuantizer(15, 4); // 15 colors, 4 bits (very low quality)...
         return(quantizer.Quantize4bpp(img));
     }
     else
     {
         return(img);
     }
 }