本文整理匯總了C#中OpenCvSharp.IplImage.AddText方法的典型用法代碼示例。如果您正苦於以下問題:C# IplImage.AddText方法的具體用法?C# IplImage.AddText怎麽用?C# IplImage.AddText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenCvSharp.IplImage
的用法示例。
在下文中一共展示了IplImage.AddText方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: QtTest
public QtTest()
{
using (CvWindow window = new CvWindow("window", WindowMode.ExpandedGui))
using (IplImage img = new IplImage(FilePath.Image.Lenna, LoadMode.Color))
{
if (CvWindow.HasQt)
{
// cvAddText
CvFont font = new CvFontQt("MS UI Gothic", 48, CvColor.Red, FontWeight.Bold, FontStyle.Italic);
img.AddText("Hello Qt!!", new CvPoint(50, img.Height - 50), font);
// cvDisplayOverlay, cvDisplayStatusBar
window.DisplayOverlay("overlay text", 2000);
window.DisplayStatusBar("statusbar text", 3000);
// cvCreateButton
CvButtonCallback buttonCallback = delegate(int state, object userdata)
{
Console.WriteLine("Button state:{0} userdata:{1} ({2})", state, userdata, userdata.GetType());
};
Cv.CreateButton("button1", buttonCallback, "my userstate", ButtonType.Checkbox, 0);
Cv.CreateButton("button2", buttonCallback, 12345.6789, ButtonType.Checkbox, 0);
// cvSaveWindowParameters
//window.SaveWindowParameters();
}
window.ShowImage(img);
// cvCreateTrackbar2
CvTrackbarCallback2 trackbarCallback = delegate(int pos, object userdata)
{
Console.WriteLine("Trackbar pos:{0} userdata:{1} ({2})", pos, userdata, userdata.GetType());
};
window.CreateTrackbar2("trackbar1", 128, 256, trackbarCallback, "foobar");
Cv.WaitKey();
}
}