Esempio n. 1
0
 /// <summary>
 /// Initializes GDI related stuff
 /// (called from constructor)
 /// </summary>
 private void GDIConstruction()
 {
     using (var g = CreateGraphics())
         using (_gdi.LockGraphics(g))
         {
             _charSize = _gdi.MeasureString("A", _commonFont);             // TODO make this a property so changing it updates other values.
         }
 }
Esempio n. 2
0
        public HexView()
        {
            NormalFont = new Font("Courier New", 8);              // Only support fixed width

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            SetStyle(ControlStyles.Opaque, true);

            Gdi = new Win32GDIRenderer();

            using (var g = CreateGraphics())
                using (var LCK = Gdi.LockGraphics(g))
                {
                    _charSize = Gdi.MeasureString("A", NormalFont);             // TODO make this a property so changing it updates other values.
                }
        }