| MIL 10 Reference
| Customize Help
| Save Settings

MgraText



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
3dmodelheightdefect.cpp
3dplanefit.cpp
advancedmeasurement.cpp
binarybasedcircledetection.cpp
bottlecapinspection.cpp
calibratedruler.cpp
calibrationfromlist.cpp
cameraevents.cpp
caninspection.cpp
caporientation.cpp
capscrewinspection_capandcontent.cpp
capscrewinspection_capandlabel.cpp
chunkmode.cpp
colorbasedproductidentification.cpp
colormatchtask.cpp
colorrelativecalibration.cpp
cookiedetection.cpp
defectdetectionexample.cpp
defectdetectiontask.cpp
dmilmdigprocesssharedmemory.cpp
dmilmultisystem.cpp
dmilobjecttrackingslave.cpp
dotspacing.cpp
examplemanager.cpp
examplemanagerfor3d.cpp
findimageorientation.cpp
fixturedcoderead.cpp
fixturingusingblob.cpp
flatfieldcorrection.cpp
foodinspection_cereal.cpp
foodinspection_mango.cpp
foodinspectioncereal.cpp
foodinspectionmango.cpp
form1.cs
form1.vb
histogramdisplay.cpp
histogramequalizeadaptive.cpp
horizontalalignment.cpp
horizontalandanglealignment.cpp
imagedownscalingmodes.cpp
imageupscalingmodes.cpp
kinect.cpp
labelalignmentinspection.cpp
lididentification.cpp
m3dmap.cpp
m3dmap.cs
m3dmap.vb
mappstart.cpp
mappstart.cs
mappstart.vb
mbufcolor.cpp
mbufcolor.cs
mbufcolor.vb
mcal.cpp
mcal.cs
mcal.vb
mcode.cpp
mcode.cs
mcode.vb
mcol.cpp
mcol.cs
mcol.vb
mdigdoublebuffering.cpp
mdigdoublebuffering.cs
mdigdoublebuffering.vb
mdiggrabsequence.cpp
mdiggrabsequence.cs
mdiggrabsequence.vb
mdigprocess.cpp
mdigprocess.cs
mdigprocess.vb
mdigprocess16vd.cpp
mdigprocessmultiple.cpp
mdispgtkview.cpp
mdispmfcview.cpp
mdispoverlay.cpp
mdispoverlay.cs
mdispoverlay.vb
mdispqtview.cpp
mdispwindow.cpp
mdispwindowgtk.cpp
mdispwindowleveling.cpp
mdispwindowleveling.cs
mdispwindowleveling.vb
mdispwindowqt.cpp
measurementalignment.cpp
mechanicalpartscan.cpp
metrologyalignment.cpp
mgrainteractive.cpp
mgrainteractive.cs
mgrainteractive.vb
mgratext.cpp
mgratext.cs
mgratext.vb
microsoftkinect.cpp
milapplication.cs
milapplication.vb
milgige.cpp
mimbinarizeadaptive.cpp
mmeas.cpp
mmeas.cs
mmeas.vb
mocr.cpp
mocr.cs
mocr.vb
morphischannelswitchingdlg.cpp
mpmenu.cpp
mpmenubutton.cpp
mseqprocess.cpp
mseqprocess.cs
mseqprocess.vb
mthread.cpp
mthread.cs
mthread.vb
multicastmaster.cpp
multicastmonitor.cpp
multicastslave.cpp
multipledatamatrixcoderead.cpp
multiviewannotations.cpp
pcbmodelmatching.cpp
pharmacodereader.cpp
positioninspection.cpp
productcountinspection.cpp
productidentificationoasis.cpp
publishingapplication.cpp
readdatamatrixtask.cpp
readstringtask.cpp
regionmanager.cpp
registeredgoldentemplate.cpp
segmentationandanalysisofcells.cpp
semiocr.cpp
stereocalibration.cpp
superresolution.cpp
threadinspection.cpp
tirestringread.cpp
utilmatchcolormap.cpp
variouscodereadings.cpp
variousdenoising.cpp
verticalalignment.cpp
viofeaturesdemo.cpp
Next
Synopsis
Draw text in an image or add text to a graphics list.
Syntax
void MgraText(
MIL_ID ContextGraId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_DOUBLE XStart, //in
MIL_DOUBLE YStart, //in
MIL_CONST_TEXT_PTR StringPtr //in
)
Description

This function draws text destructively (raster-based) in the specified image. Alternatively, this function can add a vector-based version of the text to the specified graphics list.

Note that while the location of text can sometimes change (for example, by applying a calibration or zooming the display), the text's font will always remain the same, and the text itself will never be magnified or distorted.

Text is defined by a string (StringPtr) and a starting position (XStart, YStart). Text inherits all the relevant settings of the specified graphics context, such as the foreground color (see MgraAlloc() for default context settings). If part of the text falls outside of the specified area (image or display), that part is clipped off. By default, a text's background is filled; to make it transparent, use MgraControl() with M_BACKGROUND_MODE.

To modify or inquire graphic context settings, use MgraControl() or MgraInquire(). To modify or inquire graphics list settings, use MgraControlList() or MgraInquireList().

A text's coordinates are interpreted with respect to the input coordinate system, specified using MgraControl() or MgraControlList() with M_INPUT_UNITS. Note that if you set your input coordinate system to M_WORLD and you pass MgraText() an uncalibrated image, the function will generate an error.

Unlike most other functions that modify a MIL object, you can call this function concurrently from multiple threads on the same MIL graphics list (DstImageBufOrListGraId) without using an M_MUTEX object, as long as all the other parameters of the concurrent calls do not also share data.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextGraId

Specifies the identifier of the graphics context. This parameter must be set to one of the following values:

function map For specifying the graphics context
CollapseValue Description
Collapse M_DEFAULT

Specifies that the default graphics context of the current MIL application is used.

Note that there is a different default graphics context for each thread.

(summarize)
Collapse MIL graphics context identifier

Specifies a valid graphics context identifier, which you have allocated using MgraAlloc().

DstImageBufOrListGraId

Specifies the identifier of a valid image buffer in which to draw the graphic or the identifier of a valid graphics list in which to add the graphic. You must have allocated the image buffer or the graphics list using MbufAlloc...() or MgraAllocList(), respectively.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

XStart INQ

Specifies the X-coordinate at which to start drawing the top-left corner of the first character in the input coordinate system.

YStart INQ

Specifies the Y-coordinate at which to start drawing the top-left corner of the first character in the input coordinate system.

StringPtr

Specifies the address of the string containing the text to draw in the destination buffer.

function map For specifying the string
CollapseValue Description
Collapse MIL_TEXT("String") 1

Specifies the address of the null-terminated (\0) ASCII string that must be drawn in the destination buffer (DstImageBufOrListGraId). There is no restriction on the length of the string.

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT NONE