Пример #1
0
 private BitmapBoolArray(int w, int h)
 {
     bitmapBool = ArrayExtras.InstantiateArray <bool>(w, h);
 }
Пример #2
0
        private void SetHistogramDisplay(SymbolIdentity.HistogramLetter hl)
        {
            if (hl == null)
            {
                return;
            }

            //merge arrays
            int[][] a  = ArrayExtras.InstantiateArray <int>(symbol.HistogramWidth, symbol.HistogramHeight);
            int     yc = hl.YValues.Count();
            int     xc = hl.XValues.Count();

            for (int y = 0; y < yc; y++)
            {
                for (int v = 0; v < hl.YValues[y]; v++)
                {
                    if (y >= symbol.HistogramHeight || v >= symbol.HistogramWidth)
                    {
                        continue;
                    }
                    a[y][v] += 10;
                }
            }

            for (int x = 0; x < xc; x++)
            {
                var ymax = yc - 1;
                var ymin = ymax - hl.XValues[x];
                for (int v = ymax; v > ymin; v--)
                {
                    if (v >= symbol.HistogramHeight || x >= symbol.HistogramWidth)
                    {
                        continue;
                    }
                    a[v][x] += 100;
                }
            }


            for (int y = 0; y < yc; y++)
            {
                for (int x = 0; x < xc; x++)
                {
                    if (y >= symbol.HistogramHeight || x >= symbol.HistogramWidth)
                    {
                        continue;
                    }

                    var v1 = a[y][x];
                    var c  = '1';
                    if (v1 == 10)
                    {
                        c = '4';
                    }
                    else if (v1 == 100)
                    {
                        c = '6';
                    }
                    else if (v1 == 110)
                    {
                        c = '8';
                    }

                    letterhistogramdisplayTB.Text += c;
                    Settings.Default.dictionary   += c;
                }
                letterhistogramdisplayTB.Text += Environment.NewLine;
            }
        }