473,385 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Hindi numbers in Graphics class

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

Jun 29 '06 #1
4 2936

gr*********@yahoo.com wrote:
Hi,

Is there a way to force Graphics.drawstring() method to display Hindi
numbers when printing?
Just ask it to. The Devanagari numerals are unicode characters 0966
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
lang. but no luck.
If what you actually mean is that you want to produce Devanagari digits
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

Jul 3 '06 #2

gr*********@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,stringdigitsubstit ute.national)

yourGraphicObject.graphics.drawstring(string,font, brush,x,y,sf)
HTH,
Adel Al-saleh

Jul 5 '06 #3

al******@hotmail.com wrote:
gr*********@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,stringdigitsubstit ute.national)
Wow, that's pretty cool. Thanks for that!

--
Larry Lard
Replies to group please

Jul 5 '06 #4

Larry Lard wrote:
al******@hotmail.com wrote:
gr*********@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,stringdigitsubstit ute.national)

Wow, that's pretty cool. Thanks for that!

--
Larry Lard
Replies to group please
Hello Larry,

Well, Thanks to the guyes at Microsoft for bringing good things to us,
developers.

Adel Al-saleh

Jul 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
5
by: kuldeep | last post by:
Hi all, I have developed a application that supports localization in .net. It shows all the controls with english and hindi text depending on the culture selected. The application runs well on...
0
by: kotianram | last post by:
hi, What are the changes needed in the resource file to support Hindi language using vc. I have converted the UI to CHinese and arabi etc .. Any suggestion on hindi . Regards Ramya
3
by: pratik.best | last post by:
Hi, I just seen the web site of the unicode committee and was amazed to see the site showing document in Hindi without using any such fonts like "Kruti Dev" or "Dev Lys". "Webdunia.com" is also...
1
by: dinesh tailor | last post by:
Hi i want to use UTF-8 for Hindi but i don't want to use font tag. how i can disply hindi font in HTML page using UTF. plz send example
2
by: captaina | last post by:
Hi, I have been doing web pages in english but at the moment stuck up with a website and it is to be designed in Hindi. I have tried using CSS and linking CSS to hindi fonts but its not working...
0
by: gauraw | last post by:
urgent, do any body know how to use hindi characters in c/c++ programm. i want to use hindi character in c language, how is it possible using normal turbo-c compiler(dos base). please directly...
0
by: imranabdulaziz | last post by:
Dear All, I am making web application using Asp.net C#(Visual Studio2005). And Sql server 2005 as a back End. My question Is it possible to generate report in hindi (language) format( using...
0
by: villagegreen | last post by:
I'm trying to use an html form to upload foreign language translations of English terms into a MySQL database. Since many different languages will be entered on the page, I have read that I should...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.