Method PutText
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
PutText(InputOutputArray, string, Point, HersheyFonts, double, Scalar, int, LineTypes, bool)
renders text string in the image
public static void PutText(InputOutputArray img, string text, Point org, HersheyFonts fontFace, double fontScale, Scalar color, int thickness = 1, LineTypes lineType = LineTypes.Link8, bool bottomLeftOrigin = false)
Parameters
imgInputOutputArrayImage.
textstringText string to be drawn.
orgPointBottom-left corner of the text string in the image.
fontFaceHersheyFontsFont type, see #HersheyFonts.
fontScaledoubleFont scale factor that is multiplied by the font-specific base size.
colorScalarText color.
thicknessintThickness of the lines used to draw a text.
lineTypeLineTypesLine type. See #LineTypes
bottomLeftOriginboolWhen true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner.
PutText(InputOutputArray, string, Point, Scalar, FontFace, int, int, PutTextFlags, Range?)
Draws a text string using the specified TrueType font (OpenCV 5). Symbols that cannot be rendered using the specified font are replaced by question marks.
public static Point PutText(InputOutputArray img, string text, Point org, Scalar color, FontFace fontFace, int size, int weight = 0, PutTextFlags flags = PutTextFlags.AlignLeft, Range? wrap = null)
Parameters
imgInputOutputArrayImage.
textstringText string to be drawn (UTF-8 / Unicode is supported).
orgPointBottom-left corner of the first character of the printed text (see PutTextFlags).
colorScalarText color.
fontFaceFontFaceThe font to use for the text.
sizeintFont size in pixels (by default) or pts.
weightintFont weight, 100..1000 (400 is "regular", 700 is "bold"). 0 uses the weight set via SetInstance(int[]).
flagsPutTextFlagsVarious flags, see PutTextFlags.
wrapRange?Optional text wrapping range. Null uses the default behavior.
Returns
- Point
The coordinates in pixels from where the text can be continued.