示例#1
0
        public static string Decode(Bitmap bitmap)
        {
            var byteSize = bitmap.Width * bitmap.Height * Constants.Gray8PixelSize;

            byte[] blue  = new byte[byteSize];
            byte[] green = new byte[byteSize];
            byte[] red   = new byte[byteSize];

            GetRGBByteArrayFromBitmap(bitmap, blue, green, red);
            var str1 = ColorZXingBasic.Decode(blue, bitmap.Width, bitmap.Height, BitmapFormat.Gray8);
            var str2 = ColorZXingBasic.Decode(green, bitmap.Width, bitmap.Height, BitmapFormat.Gray8);
            var str3 = ColorZXingBasic.Decode(red, bitmap.Width, bitmap.Height, BitmapFormat.Gray8);

            return(str1 + str2 + str3);
        }
示例#2
0
 public static string Decode(byte[] bytes)
 {
     return(ColorZXingBasic.Decode(bytes));
 }
示例#3
0
 public static string Decode(Uri url)
 {
     return(ColorZXingBasic.Decode(url));
 }
示例#4
0
 public static string Decode(Bitmap bitmap)
 {
     return(ColorZXingBasic.Decode(bitmap));
 }