473,508 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing culture for Graphics.DrawString

Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}


Dec 7 '05 #1
3 2232
Gürkan,

The current culture has nothing to do with how characters are rendered.
A character has one value, that's it. The problem here is that your font
doesn't support those characters, hence the black boxes.

You have to use a different font which supports the characters.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Gürkan Demirci" <fa********@host.de> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}

Dec 7 '05 #2
using a font which supports japanese characters would certainly help.
"Gürkan Demirci" <fa********@host.de> schrieb im Newsbeitrag
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}

Dec 7 '05 #3
thank you both.

that solved my problem

regards

"Gürkan Demirci" <fa********@host.de> schrieb im Newsbeitrag
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

i am trying to write Jananese characters with DrawString().
It is not working. The characters a printed as boxes only.

How can i change the culture of my windows forms application ?
It seems not to work, because an additional textbox isn't printing in
japanese charaters, too.

best regards,

gürkan
This is the code:
private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)

{

System.Windows.Forms.Application.CurrentCulture =new CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentCultu re = new
CultureInfo("ja-JP");

System.Threading.Thread.CurrentThread.CurrentUICul ture = new
CultureInfo("ja-JP");

e.Graphics.DrawString("\u307b,\u308b,\u305a,\u3042 ,\u306d"/*,"????"*/,normalFont,titleBrush,50,50);

}

Dec 7 '05 #4

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

Similar topics

0
1380
by: twostepted | last post by:
Hello, This is a bit of a long post (sorry) but here is the jist of it: I've developed a Windows forms User Control marquee (auto-scrolling text like a readerboard). I'm trying to optimize it...
5
27122
by: Charles A. Lackman | last post by:
Hello, I have created a complete PrintDocument and need to create an image from it. How is this done? e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality...
3
15386
by: Mad Scientist Jr | last post by:
Can someone post a clear example of how to change the background color of an individual datagrid cell for a Windows desktop app? (preferably in vb.net) I found some code on how to do this when...
3
31786
by: D Witherspoon | last post by:
No matter what I do the default paper size is always either A3 or 11 by 8.5 .. Here is the code. Dim dlg As DialogResult pd.DocumentName = "Weld Image" Dim pkPaperSize As New...
7
3010
by: Michael Galvin | last post by:
I am trying to use Python to send to the printer a calender filled with a mix of text and simple graphics. I want to draw on the printed page something like a table with 6 rows and 7 columns to...
7
2561
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
6
4299
by: Dom | last post by:
In some programs, I see that certain items in a listbox have been grayed, to indicate that they are "there" but can not be chosen. This is very helpful. Can you do this in CSharp? Is there a...
2
12630
by: Tony Johansson | last post by:
Hello! If I use the DrawString below with object of StringFormat as the last object it works good. If I instead remove object StringFormat below as the last object of DrawString I get some rows...
6
2664
by: Dilip | last post by:
Howdy Folks I have a display where the Graphics.DrawString function is called to display something. Since the text seems to be larger than its bounding rectangle, the call basically splits the...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
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,...
0
4724
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...
0
3214
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...
0
1568
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 ...
1
773
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.