Exemple #1
0
        internal D2dTextFormat(TextFormat textFormat)
        {
            if (textFormat == null)
            {
                throw new ArgumentNullException("textFormat");
            }
            m_nativeTextFormat = textFormat;

            m_ellipsisTrimming = new EllipsisTrimming(D2dFactory.NativeDwFactory, m_nativeTextFormat);
            m_fontHeight       = D2dFactory.FontSizeToPixel(m_nativeTextFormat.FontSize);
        }
Exemple #2
0
        /// <summary>
        /// Constructor</summary>
        public Direct2DControl()
        {
            SetStyle(
                ControlStyles.ResizeRedraw |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.Opaque |
                ControlStyles.UserPaint, true);

            // D2dHwndGraphics needs to be resized on size changed. Look at OnResize.
            D2dGraphics = D2dFactory.CreateD2dHwndGraphics(Handle);
        }