473,395 Members | 2,437 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,395 software developers and data experts.

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 9802
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Atif | last post by:
Hello all, In my html page I want to add an image say of 800x600. Now I want that when ever I am given two coordinates on this image say (x1, y1)=(50, 100) and (x2, y2)=(200, 300), the java script...
8
by: john | last post by:
Hi I am a C++ newbie, I am looking to draw single lines and simple boxes in a C++ console window. Is there a draw command with x and y coordinates that can be used with my Dev C++ compiler. For...
10
by: Zach | last post by:
In an invoicing program I draw lines in a text file using: new string ("-",73) new string ("=",73) These lines look awful. Is there a better way? Much obliged.
2
by: George | last post by:
Dear colleagues, I refer to your help with specific graphic problem. It is necessary to create a viewfinder in graphic application. It seems that the algorithm is simple: just draw lines in...
1
by: AMP | last post by:
Hello, I am looking for sample code to draw text on an arc. I see the stringFormat.FormatFlags enum for vertical but nothing for arcs. I could do it with lenthy trig algorythm that would take in...
11
by: Galen Somerville | last post by:
In my opinion, one of the worst failures of Net (VB2005 Pro) was not providing an XOR line draw feature, as in VB6. A major feature of my app is allowing the user to draw Markers (vertical...
4
by: DM | last post by:
Hi All, I've recently been given the task of modifying some legacy VB 6 code to do with drawing rotated ellipses on a map at different zoom levels. I guess I could find a formula for drawing...
1
by: roryok | last post by:
I've got the following to draw a vertical line on each control followed by a rectangle around the Details section in a report. What I cannot seem to find in Access VBA Help is how to set the...
0
by: emilnordiclake | last post by:
(C#, Microsoft .NET Framework 3.5) Hello! I'm in the process of creating a custom text control and I want to add functionality for superscripts and subscripts. I'm using TextRenderer for...
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:
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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
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...
0
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...

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.