Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imaqOverlayText() method isn't working for me

I am programming in Visual C++ and having some trouble with imaqOverlayText(...).
The following code shows the overlay text with the imaqDisplayImage but it doesn't show up when I write the .png.
 

status = imaqOverlayText(imageOut, partCenter, "Hey There", &(IMAQ_RGB_RED), &options, NULL);

status = imaqDisplayImage(imageOut, 0, TRUE);

strcpy(filename, partName);

strcat(filename, "after.png");

//imaqWriteFile(imageOut, filename, &IMAQ_RGB_WHITE);

status = imaqWritePNGFile(imageOut, filename, 1000, &IMAQ_RGB_WHITE);

I have tried to change the output image to a .bmp or a .jpg, neither of those types show the overlay text either.

Is the overlay text hidden in some layer that doesn't write to disk?

0 Kudos
Message 1 of 7
(4,091 Views)
turboPres -

You are correct - the overlays are stored separately from the image, since they are non-destructive.  To put the overlays on the image, use the imaqMergeOverlay() function - then they should show up when you save them to a .bmp or .jpg.

Greg Stoll
IMAQ R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 2 of 7
(4,089 Views)
Thanx
0 Kudos
Message 3 of 7
(4,083 Views)

Greg,

I took a look around the library and help files for imaqMergeOverlay() function. It doesn't exist!?! Following are the overlay functions available to me.

Class LabWindows/CVI Equivalent Function Name
Overlay Clear Overlay imaqClearOverlay
Overlay Copy Overlay imaqCopyOverlay
Overlay Overlay Arc imaqOverlayArc
Overlay Overlay Closed Contour imaqOverlayClosedContour
Overlay Overlay Line imaqOverlayLine
Overlay Overlay Metafile imaqOverlayMetafile
Overlay Overlay Open Contour imaqOverlayOpenContour
Overlay Overlay Oval imaqOverlayOval
Overlay Overlay Points imaqOverlayPoints
Overlay Overlay Rect imaqOverlayRect
Overlay Overlay ROI imaqOverlayROI
Overlay Overlay Text imaqOverlayText

0 Kudos
Message 4 of 7
(4,080 Views)

Greg,

I am using May 2001 Edition. Part Number 370379A-01.

0 Kudos
Message 5 of 7
(4,076 Views)
turboPres -

It looks like you're using IMAQ Vision 6.0 - imaqMergeOverlay() is only available in IMAQ Vision 7.1 (the current version).

Alternatively, you can use imaqDrawTextOnImage() to put text directly on the image - in this case, you wouldn't need the overlay.

Greg Stoll
IMAQ R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 6 of 7
(4,075 Views)
It works
 
Thank you very much
0 Kudos
Message 7 of 7
(4,069 Views)