Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

write vertical text using DrawString

I want to write a vertical text in my graphic instances using DrawString.

My code is like this :

var graph = Graphics.FromImage(map);

And I read the text and their position from Database :

graph.DrawString(ObjStationRepository.FindBy(i => i.Id == t.StationId).First().Description, new Font("B Nazanin", 18), Brushes.White, t.XLocation + 70, t.YLocation +80);

But my problem is ,i need to write the text in vertical position not horizontal .But DrawString write the text in horizontal !!

Best regards

like image 717
Ehsan Akbar Avatar asked Sep 20 '25 14:09

Ehsan Akbar


1 Answers

Use

System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat();
drawFormat.FormatFlags = StringFormatFlags.DirectionVertical;

and add it as the last param to DrawString

like image 118
adjan Avatar answered Sep 22 '25 06:09

adjan