Ejemplo n.º 1
0
        /// <summary>
        /// create text layout using explicit style declaration
        /// </summary>
        /// <param name="sciterText"></param>
        /// <param name="text"></param>
        /// <param name="elementHandle"></param>
        /// <param name="style"></param>
        /// <returns></returns>
        public static bool TryCreateForElementAndStyle(out SciterText sciterText, string text, IntPtr elementHandle, string style)
        {
            var result = GraphicsApi.TextCreateForElementAndStyle(out var textHandle, text, (uint)text.Length, elementHandle, style, (uint)style.Length)
                         .IsOk();

            sciterText = result ? new SciterText(textHandle) : default;
            return(result);
        }
Ejemplo n.º 2
0
        public static bool TryFromValue(out SciterText sciterText, SciterValue sciterValue)
        {
            var value  = sciterValue.ToVALUE();
            var result = GraphicsApi.ValueUnWrapText(ref value, out var textHandle)
                         .IsOk();

            sciterText = result ? new SciterText(textHandle) : default;
            return(result);
        }
Ejemplo n.º 3
0
        public static bool TryCreateForElement(out SciterText sciterText, string text, IntPtr elementHandle, string className = null)
        {
            if (elementHandle == IntPtr.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(elementHandle), $@"IntPtr.Zero received at {nameof(TryCreateForElement)}.");
            }

            var result = GraphicsApi.TextCreateForElement(out var textHandle, text, (uint)text.Length, elementHandle, className)
                         .IsOk();

            sciterText = result ? new SciterText(textHandle) : default;
            return(result);
        }
Ejemplo n.º 4
0
 public static bool TryCreateForElement(out SciterText sciterText, string text, SciterElement element, string className = null)
 {
     return(TryCreateForElement(out sciterText, text: text, elementHandle: element?.Handle ?? IntPtr.Zero, className: className));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// create text layout using explicit style declaration
 /// </summary>
 /// <param name="sciterText"></param>
 /// <param name="text"></param>
 /// <param name="element"></param>
 /// <param name="style"></param>
 /// <returns></returns>
 public static bool TryCreateForElementAndStyle(out SciterText sciterText, string text, SciterElement element, string style)
 {
     return(TryCreateForElementAndStyle(sciterText: out sciterText, text: text, elementHandle: element.Handle, style: style));
 }
 public static bool TryDrawText(this SciterGraphics graphics, SciterText text, float px, float py, uint position)
 {
     return(graphics?.TryDrawTextInternal(text: text, px: px, py: py, position: position) == true);
 }
 public static SciterGraphics DrawText(this SciterGraphics graphics, SciterText text, float px, float py, uint position)
 {
     graphics?.DrawTextInternal(text: text, px: px, py: py, position: position);
     return(graphics);
 }