hi, i use this code for show utf8 text on image, [ Persian text, utf8 format ], but my text show inverted! - how i can fix this problem?
#region Create Image Output
Mat ImageOutput = new Mat(400, 600, DepthType.Cv8U, 3);
ImageOutput.SetTo(new MCvScalar(System.Drawing.Color.Wheat.B, System.Drawing.Color.Wheat.G, System.Drawing.Color.Wheat.R));
#endregion
#region Variables
string text = "سلام";
var centerPoint = new System.Drawing.Point(ImageOutput.Cols / 2, ImageOutput.Rows / 2);
int fontHeight = 36;
MCvScalar color = new MCvScalar(0, 0, 255);
int thickness = 1;
LineType lineType = LineType.EightConnected;
bool bottomLeftOrigin = false;
#endregion
#region Add text to image
// create an object from 'Freetype2' class
Emgu.CV.Freetype.Freetype2 freetype2 = new Emgu.CV.Freetype.Freetype2();
// set font
string windowsFontsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts);
string fontPath = windowsFontsPath + @"\Tahoma.ttf";
freetype2.LoadFontData(fontPath, 0);
// PutText
freetype2.PutText(ImageOutput, text, centerPoint, fontHeight, color, thickness, lineType, bottomLeftOrigin);
#endregion
#region Show Result
AddImage(ImageOutput.ToImage<Bgr,byte>(), "ImageOutput");
#endregion
What my code shows in the output is wrong ( it is displayed in reverse ) :
My codes should show this text [ when i try publish my question, site tell me "Sorry, new users can only put one embedded media item in a post.
" then i upload second image on other website ]:
- سلام = HI