Esempio n. 1
0
        public void AddString(string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat? format)
        {
            if (family == null)
                throw new ArgumentException(nameof(family));

            IntPtr sformat = (format == null) ? IntPtr.Zero : format.nativeFormat;
            // note: the NullReferenceException on s.Length is the expected (MS) exception
            int status = Gdip.GdipAddPathStringI(_nativePath, s, s.Length, family.NativeFamily, style, emSize, ref layoutRect, sformat);
            Gdip.CheckStatus(status);
        }
Esempio n. 2
0
        public void AddString(string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat?format)
        {
            ArgumentNullException.ThrowIfNull(family);

            Gdip.CheckStatus(Gdip.GdipAddPathStringI(
                                 new HandleRef(this, _nativePath),
                                 s,
                                 s.Length,
                                 new HandleRef(family, family?.NativeFamily ?? IntPtr.Zero),
                                 style,
                                 emSize,
                                 ref layoutRect,
                                 new HandleRef(format, format?.nativeFormat ?? IntPtr.Zero)));
        }