473,763 Members | 4,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hindi numbers in Graphics class

Hi,

Is there a way to force Graphics.drawst ring() 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 2989

gr*********@yah oo.com wrote:
Hi,

Is there a way to force Graphics.drawst ring() 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_Pai nt(ByVal sender As Object, _
ByVal e As System.Windows. Forms.PaintEven tArgs) _
Handles PictureBox1.Pai nt

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(out put, 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*********@yah oo.com wrote:
Hi,

Is there a way to force Graphics.drawst ring() 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.globaliz ation
imports system.drawing

Dim sf as new stringformat
Dim hd as new cultureinfo("ar-SA") 'just select any arabic culture

sf.setdigitsubs titution(hd.lci d,stringdigitsu bstitute.nation al)

yourGraphicObje ct.graphics.dra wstring(string, font,brush,x,y, sf)
HTH,
Adel Al-saleh

Jul 5 '06 #3

al******@hotmai l.com wrote:
gr*********@yah oo.com wrote:
Hi,

Is there a way to force Graphics.drawst ring() 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.globaliz ation
imports system.drawing

Dim sf as new stringformat
Dim hd as new cultureinfo("ar-SA") 'just select any arabic culture

sf.setdigitsubs titution(hd.lci d,stringdigitsu bstitute.nation al)
Wow, that's pretty cool. Thanks for that!

--
Larry Lard
Replies to group please

Jul 5 '06 #4

Larry Lard wrote:
al******@hotmai l.com wrote:
gr*********@yah oo.com wrote:
Hi,
>
Is there a way to force Graphics.drawst ring() 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.globaliz ation
imports system.drawing

Dim sf as new stringformat
Dim hd as new cultureinfo("ar-SA") 'just select any arabic culture

sf.setdigitsubs titution(hd.lci d,stringdigitsu bstitute.nation al)

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
2386
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 graphics object of the form/pictureBox. Should It be better if make a graphics object from my pictureBox in load event handler of the form and store it as member variable of the form , make
5
3140
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 windows 2000 and windows xp but when run on windows 98 the hindi text appears as garbage. Can anyone help out with this.(I have installed the .net framework on windows 98) Regards,
0
1932
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
29727
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 showing documents in Hindi without the need to download any specific font. How's that done? Also, can I build such a page?
1
3816
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
1889
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 out for me. Can anyone help and or guide me through.
0
1466
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 respond me on my mail id **email removed**
0
1435
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 anything crystal report or report services of sql server) . Every thing will be in English(all master and transaction entry form in english) only thing i want to generate report language be in hindi. Please suggest me some idea or give me some...
0
4300
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 set the charset on my uploading page as follows: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> This has worked great for many different languages, including: Arabic, Spanish, Mandarin, etc. Basically, I have all the...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.