public static Matrix SetIdentity() { Matrix matrix = new Matrix(); LibuiLibrary.uiDrawMatrixSetIdentity(LibuiConvert.ToLibuiDrawMatrix(matrix)); return(matrix); }
/// <summary> /// Initializes a new instance of the <see cref="CheckBox"/> class with the specified text. /// </summary> /// <param name="text">The text specified by the <see cref="CheckBox"/>.</param> public CheckBox(string text) { IntPtr strPtr = LibuiConvert.ToLibuiString(text); Handle = new SafeControlHandle(LibuiLibrary.uiNewCheckbox(strPtr)); Marshal.FreeHGlobal(strPtr); this.text = text; InitializeEvents(); }
/// <summary> /// Initializes a new instance of the <see cref="Window"/> class, with the options of specifying /// the window's width, height, title, and whether or not it has a <see cref="MenuStrip"/>. /// </summary> /// <param name="width">The width of the window.</param> /// <param name="height">The height of the window.</param> /// <param name="title">The title at the top of the window.</param> /// <param name="hasMenuStrip">Whether or not the window will have a menu.</param> public Window(int width = 500, int height = 300, string title = null, bool hasMenuStrip = false) : base() { if (string.IsNullOrEmpty(title)) { title = "LibUISharp"; } IntPtr strPtr = LibuiConvert.ToLibuiString(title); Handle = new SafeControlHandle(LibuiLibrary.uiNewWindow(strPtr, width, height, hasMenuStrip)); Marshal.FreeHGlobal(strPtr); WindowCache.Add(Handle, this); this.title = title; size = new Size(width, height); InitializeEvents(); }
/// <inheritdoc /> protected sealed override void InitializeComponent() { if (PlatformHelper.IsWinNT) { IntPtr ptr = Kernel32Library.GetConsoleWindow(); User32Library.ShowWindow(ptr, 0); // 0 = SW_HIDE, 4 = SW_SHOWNOACTIVATE } IntPtr errPtr = LibuiLibrary.uiInit(ref Options); string errStr = LibuiConvert.ToString(errPtr); if (string.IsNullOrEmpty(errStr)) { Console.WriteLine(errStr); LibuiLibrary.uiFreeInitError(errPtr); throw new LibuiException(errStr); } }
public void Transform(Matrix matrix) => LibuiLibrary.uiDrawTransform(Handle.DangerousGetHandle(), LibuiConvert.ToLibuiDrawMatrix(matrix));
public SizeD TransformToSize() { LibuiLibrary.uiDrawMatrixTransformSize(LibuiConvert.ToLibuiDrawMatrix(this), out double width, out double height); return(new SizeD(width, height)); }
public PointD TransformToPoint() { LibuiLibrary.uiDrawMatrixTransformPoint(LibuiConvert.ToLibuiDrawMatrix(this), out double x, out double y); return(new PointD(x, y)); }
public void Invert() => LibuiLibrary.uiDrawMatrixInvert(LibuiConvert.ToLibuiDrawMatrix(this));
public static void Multiply([Out] Matrix dest, [In] Matrix src) => LibuiLibrary.uiDrawMatrixMultiply(LibuiConvert.ToLibuiDrawMatrix(dest), LibuiConvert.ToLibuiDrawMatrix(src));
public void Skew(double x, double y, double xamount, double yamount) => LibuiLibrary.uiDrawMatrixSkew(LibuiConvert.ToLibuiDrawMatrix(this), x, y, xamount, yamount);
public void Rotate(double x, double y, double amount) => LibuiLibrary.uiDrawMatrixRotate(LibuiConvert.ToLibuiDrawMatrix(this), x, y, amount);
public void Scale(double xCenter, double yCenter, double x, double y) => LibuiLibrary.uiDrawMatrixScale(LibuiConvert.ToLibuiDrawMatrix(this), xCenter, yCenter, x, y);
public void Translate(double x, double y) => LibuiLibrary.uiDrawMatrixTranslate(LibuiConvert.ToLibuiDrawMatrix(this), x, y);