469,926 Members | 1,489 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Drawing vertical string

Hello,

the following code draws 'top to bottom' vertical text,
any ideas how to draw 'bottom to top' one?
g.DrawString("This is a test vertical string", New Font("Tahoma", 8,
FontStyle.Regular), New SolidBrush(Color.Gray), 100, 10, New
StringFormat(StringFormatFlags.DirectionVertical))

I would gratefully appreciate any help

thanks,
Adriano
Jun 23 '06 #1
3 9356
Hi Adriano,

I don't know if there is one. But you can call StrReverse(yourString).

Ahmed

Adriano wrote:
Hello,

the following code draws 'top to bottom' vertical text,
any ideas how to draw 'bottom to top' one?
g.DrawString("This is a test vertical string", New Font("Tahoma", 8,
FontStyle.Regular), New SolidBrush(Color.Gray), 100, 10, New
StringFormat(StringFormatFlags.DirectionVertical))

I would gratefully appreciate any help

thanks,
Adriano


Jun 23 '06 #2
hello Ahmet,

thanks for your reply, that's just reverses the sentence,
what I actually need is to turn the word 180 degrees,
any other ideas?

regards,
Adriano

"Ahmed" <ah*******@gmail.com> wrote in message
news:11**********************@r2g2000cwb.googlegro ups.com...
Hi Adriano,

I don't know if there is one. But you can call StrReverse(yourString).

Ahmed

Adriano wrote:
Hello,

the following code draws 'top to bottom' vertical text,
any ideas how to draw 'bottom to top' one?
g.DrawString("This is a test vertical string", New Font("Tahoma", 8,
FontStyle.Regular), New SolidBrush(Color.Gray), 100, 10, New
StringFormat(StringFormatFlags.DirectionVertical))

I would gratefully appreciate any help

thanks,
Adriano

Jun 23 '06 #3
Adriano,
You should be able to use a rotation to have it draw "bottom to top"

Something like (VB 2005 syntax):

Using font As System.Drawing.Font = New Font("Tahoma", 8,
FontStyle.Regular)
Using brush As System.Drawing.SolidBrush = New
SolidBrush(Color.Gray)
Using format As System.Drawing.StringFormat = New
StringFormat(StringFormatFlags.DirectionVertical)
Dim location As System.Drawing.Point = New
Point(ClientSize.Width \ 2, ClientSize.Height \ 2)
Dim transform As System.Drawing.Drawing2D.Matrix =
e.Graphics.Transform
transform.RotateAt(180, location)
e.Graphics.Transform = transform
e.Graphics.DrawString("This is a test vertical string",
font, brush, location, format)
End Using
End Using
End Using

The quirk is getting the location right. At the rotation causes the
coordinates to be "turned upside down"...

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Adriano" <ad*****@mail.it> wrote in message
news:Oq**************@TK2MSFTNGP02.phx.gbl...
| Hello,
|
| the following code draws 'top to bottom' vertical text,
| any ideas how to draw 'bottom to top' one?
| g.DrawString("This is a test vertical string", New Font("Tahoma", 8,
| FontStyle.Regular), New SolidBrush(Color.Gray), 100, 10, New
| StringFormat(StringFormatFlags.DirectionVertical))
|
| I would gratefully appreciate any help
|
| thanks,
| Adriano
|
|
Jun 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by Atif | last post: by
10 posts views Thread by Zach | last post: by
1 post views Thread by AMP | last post: by
11 posts views Thread by Galen Somerville | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.