|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Hindi numbers in Graphics classHi,
Is there a way to force Graphics.drawstring() method to display Hindi numbers when printing? I changed the locale settings of the Regional Options to an Arabic lang. but no luck. MTIA, Grawsha grawsha2***@yahoo.com wrote:
> Hi, Just ask it to. The Devanagari numerals are unicode characters 0966> > Is there a way to force Graphics.drawstring() method to display Hindi > numbers when printing? through 096F. Be sure to use a font that contains these characters, such as Arial Unicode. Example: Create a new Windows Forms app, put a picturebox on the form, add this code: Private Sub PictureBox1_Paint(ByVal sender As Object, _ ByVal e As System.Windows.Forms.PaintEventArgs) _ Handles PictureBox1.Paint Dim deva_digits As Char() = New Char(9) {} For i As Integer = 0 To 9 deva_digits(i) = ChrW(&H966 + i) Next Dim output As String = deva_digits(1) & deva_digits(2) & _ deva_digits(3) & "+" & deva_digits(4) & deva_digits(5) & _ deva_digits(6) & "=" & deva_digits(5) & deva_digits(7) & _ deva_digits(9) Using unifont As Font = New Font("Arial Unicode", 14) With e.Graphics .DrawString(output, unifont, Brushes.Black, 0, 0) End With End Using End Sub > I changed the locale settings of the Regional Options to an Arabic If what you actually mean is that you want to produce Devanagari digits> lang. but no luck. when output characters "0" through "9", I suspect this isn't going to happen. -- Larry Lard Replies to group please When starting a new topic, please mention which version of VB/C# you are using grawsha2***@yahoo.com wrote:
> Hi, Hello Grawsha,> > Is there a way to force Graphics.drawstring() method to display Hindi > numbers when printing? > > I changed the locale settings of the Regional Options to an Arabic > lang. but no luck. > > > MTIA, > Grawsha Do this: imports system.globalization imports system.drawing Dim sf as new stringformat Dim hd as new cultureinfo("ar-SA") 'just select any arabic culture sf.setdigitsubstitution(hd.lcid,stringdigitsubstitute.national) yourGraphicObject.graphics.drawstring(string,font,brush,x,y,sf) HTH, Adel Al-saleh alsal***@hotmail.com wrote:
Show quoteHide quote > grawsha2***@yahoo.com wrote: Wow, that's pretty cool. Thanks for that!> > Hi, > > > > Is there a way to force Graphics.drawstring() method to display Hindi > > numbers when printing? > > > > I changed the locale settings of the Regional Options to an Arabic > > lang. but no luck. > > > > > > MTIA, > > Grawsha > > Hello Grawsha, > > Do this: > > imports system.globalization > imports system.drawing > > Dim sf as new stringformat > Dim hd as new cultureinfo("ar-SA") 'just select any arabic culture > > sf.setdigitsubstitution(hd.lcid,stringdigitsubstitute.national) -- Larry Lard Replies to group please Larry Lard wrote:
Show quoteHide quote > alsal***@hotmail.com wrote: Hello Larry,> > grawsha2***@yahoo.com wrote: > > > Hi, > > > > > > Is there a way to force Graphics.drawstring() method to display Hindi > > > numbers when printing? > > > > > > I changed the locale settings of the Regional Options to an Arabic > > > lang. but no luck. > > > > > > > > > MTIA, > > > Grawsha > > > > Hello Grawsha, > > > > Do this: > > > > imports system.globalization > > imports system.drawing > > > > Dim sf as new stringformat > > Dim hd as new cultureinfo("ar-SA") 'just select any arabic culture > > > > sf.setdigitsubstitution(hd.lcid,stringdigitsubstitute.national) > > Wow, that's pretty cool. Thanks for that! > > -- > Larry Lard > Replies to group please Well, Thanks to the guyes at Microsoft for bringing good things to us, developers. Adel Al-saleh
need help with a string manipulation.
+ and & operators Threads do not Terminate! a simply VB.net/ SQL SERVER question OpenFileDialog Handle Leak read textbox into array - vb2005 DataGridView Question - VB.NET 2005 REGULAR EXPRESSION extract a word and text around it change cursor to hourglass (WaitCursor) between try..catch Icons for explorer app depending on OS |
|||||||||||||||||||||||