Пример #1
0
        public void AddChar(char value)
        {
            if (charImages.ContainsKey(value))
            {
                throw new Exception();
            }

            var bitmap = new Bitmap(charWidth, charHeight);

            using (var graphics = Graphics.FromImage(bitmap))
            {
            }

            var characterTexture = new CharBitmap
            {
                Bitmap = bitmap,
                Width  = 0,
                Height = 0,
            };

            charImages.Add(value, characterTexture);
        }
Пример #2
0
        public void AddCharFromImage(char value, string path)
        {
            if (charImages.ContainsKey(value))
            {
                throw new Exception();
            }

            var bitmap = new Bitmap(path);

            if (bitmap.Width != charWidth && bitmap.Height != charHeight)
            {
                throw new Exception();
            }

            var characterTexture = new CharBitmap
            {
                Bitmap = bitmap,
                Width  = 0,
                Height = 0,
            };

            charImages.Add(value, characterTexture);
        }