开发者

How can I use .Net system.drawing.drawstring to write right-to-left string (project is a dll)?

开发者 https://www.devze.com 2023-02-07 06:54 出处:网络
Hi I need to create a bitmap file from an string, currently I\'m using Bitmap b = new Bitmap(106, 21);

Hi I need to create a bitmap file from an string, currently I'm using

Bitmap b = new Bitmap(106, 21);
Font f = new Font("Tahoma",5 );
StringFormat sf = new StringFormat();            
int faLCID = new System.Globalization.CultureInfo("fa-IR").LCID;
sf.SetDigitSubstitution(faLCID, StringDigitSubstitute.National);            
Brush brush = Brushes.Black;
Point pos = new Point(2, 2);
Graphics c = Graphics.FromImage(b);                        
c.FillRectangle(Brushes.White, 0, 0, m_width, m_length);
c.DrawString(stringText, f, brush, pos,sf);

it works but the problem is it is writing left to right. How can I make DrawString() to write right-to-开发者_如何学Pythonleft? thanx


Pass StringFormatFlags.DirectionRightToLeft.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号