How to use other font than HERSHEY with cvPutText and cvfontQt (Bug #4155)
Description
i want to use arial font to write a text on am image for which i am using cvfontqt the code works gud with its default font and cvputtext but it throws this error: 'cvAddText' : cannot convert parameter 4 from 'CvFont' to 'CvFont *'
i tried searching this on web bt couldnt not find any help
code:
IplImage* src=cvLoadImage("C:\images1.jpg");
CvFont font = cvFontQt("Arial",-1,cvScalarAll(0),CV_FONT_NORMAL,CV_STYLE_NORMAL,0);
cvAddText( src,"Hello world", cvPoint(1,1),font);
Associated revisions
Merge pull request #4155 from MSOpenTech:highgui_contrib
History
Updated by Paarth Neekhara about 10 years ago
That's an error in your code. cvAddText takes parameter as a pointer to CvFont. Change the last line to:
cvAddText( src,"Hello world", cvPoint(1,1), &font);
This would work.
- % Done changed from 0 to 100
- Status changed from New to Done
Updated by Steven Puttemans about 10 years ago
Why do you keep using ancient and depricated C API?
Use the C++ interface and all your headaches will be gone!