Show / Hide Table of Contents

Class osdText

Shows text on screen, like a tooltip or with transparent background.

public class osdText : OsdWindow, IDisposable
Remarks

Creates a temporary partially transparent window, and draws text in it. Most properties cannot be changed after creating OSD window.


Namespace: Au
Assembly: Au.dll
Inheritance
object
OsdWindow
osdText
Inherited Members
OsdWindow.Dispose()
OsdWindow.Close()
OsdWindow.Hwnd
OsdWindow.IsHandleCreated
OsdWindow.Redraw()
OsdWindow.Invalidate()
OsdWindow.Opacity
OsdWindow.TransparentColor
OsdWindow.Visible
OsdWindow.Hide()
OsdWindow.Name
OsdWindow.closeAll(string)

Constructors

Name Description
osdText()

Properties

Name Description
BackColor

Background color. Default: osdText.defaultBackColor.

BackgroundImage

Background image.

BorderColor

Border color. Default: osdText.defaultBorderColor.

ClickToClose

If true, the OSD window receive mouse messages. Only completely transparent areas don't. The user can click to close the OSD (left, right or middle button).

Font

Font. Default: osdText.defaultSmallFont.

Icon

Icon or image at the left. Can be icon, System.Drawing.Icon or System.Drawing.Image. Any size. For example System.Drawing.SystemIcons.Information or icon.stock(StockIcon.INFO) or ImageUtil.LoadGdipBitmapFromXaml("XAML copied from the Icons tool. You can edit, Width, Height and Fill (color).", screen.primary.Dpi).

IsOfImageSize

When used osdText.BackgroundImage, the OSD window has the same size as the image, plus borders. Else OSD window size is calculated from sizes of text and icon. Then image is displayed scaled or clipped if need.

Rect

Gets or sets OSD window size and position in screen.

ResizeWhenContentChanged

When changing text, resize/move the OSD window if need. Default: false.

SecondsTimeout

Close the OSD window after this time, seconds. If 0 (default), depends on text length. Can be System.Threading.Timeout.Infinite (-1).

Shadow

If true, the OSD window will have shadow.

ShowMode

See OsdMode.

Text

Text in OSD window.

TextColor

Text color. Default: osdText.defaultTextColor.

TextFormatFlags

Gets or sets text format flags. Default: TFFlags.NOPREFIX | TFFlags.WORDBREAK | TFFlags.EXPANDTABS.

WrapWidth

Maximal text width. Default: 0 - no limit (depends on screen width etc).

XY

Coordinates. Default: null (screen center).

defaultBackColor

Default background color for osdText.showText and osdText. Default: 0xFFFFF0 (light yellow).

defaultBigFont

Default font for osdText.showTransparentText. Default: standard GUI font (usually Segoe UI), size 24.

defaultBorderColor

Default border color for osdText.showText and osdText. Default: 0x404040 (dark gray).

defaultScreen

Default screen when osdText.XY is not set. The screen must be lazy or empty.

defaultSmallFont

Default font for osdText.showText and osdText. Default: standard GUI font (usually Segoe UI), size 12.

defaultTextColor

Default text color for osdText.showText and osdText. Default: 0x(dark gray).

defaultTransparentTextColor

Default text color for osdText.showTransparentText. Default: 0x8A2BE2 (Color.BlueViolet).

Methods

Name Description
Dispose(bool)
Measure()

Calculates OSD window size and position. Can be called before showing OSD.

OnPaint(nint, Graphics, RECT)

Draws OSD text etc.

Show()

Shows the OSD window. Creates if need. By default does not wait; the window will be closed after osdText.SecondsTimeout.

WndProc(wnd, int, nint, nint)

Called when the OSD window receives a message. If your derived class overrides this function, it must call base.WndProc and return its return value, except when don't need default processing.

showImage(Image, int, PopupXY, string, OsdMode, bool)

Shows on-screen image.

showText(string, int, PopupXY, object, ColorInt?, ColorInt?, FontNSS, string, OsdMode, bool)

Shows a tooltip-like OSD window with text and optionally icon.

showTransparentText(string, int, PopupXY, ColorInt?, FontNSS, string, OsdMode, bool)

Shows a big-font text with transparent background.