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
Inherited Members
Constructors
Name | Description |
---|---|
osdText() |
Properties
Name | Description |
---|---|
BackColor | Background color. Default: osdText.defaultBackColor. |
BackgroundImage | Background image. |
BorderColor | Border color. Default: osdText.defaultBorderColor. |
ClickToClose | If |
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 |
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: |
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 |
ShowMode | See OsdMode. |
Text | Text in OSD window. |
TextColor | Text color. Default: osdText.defaultTextColor. |
TextFormatFlags | Gets or sets text format flags.
Default: |
WrapWidth | Maximal text width. Default: 0 - no limit (depends on screen width etc). |
XY | Coordinates.
Default: |
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 |
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. |