473,782 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Draw a string vertically

I want to draw a string that is at a 90 degree angle instead of left to
right it would be rotated 90 degrees... how would you go about doing this?
thanks!
Mar 21 '07 #1
2 1506
On Mar 21, 1:45 pm, "Smokey Grindel" <nos...@nospam. comwrote:
I want to draw a string that is at a 90 degree angle instead of left to
right it would be rotated 90 degrees... how would you go about doing this?
thanks!
Private Sub Form1_Paint(ByV al sender As Object, ByVal e As
System.Windows. Forms.PaintEven tArgs) Handles MyBase.Paint
Dim txt As String = "www.java2s.com "
Dim the_font As New Font("Times New Roman", 30,
FontStyle.Bold, GraphicsUnit.Pi xel)
Dim layout_rect As New RectangleF(0, 0, _
Me.ClientSize.W idth - 1, Me.ClientSize.H eight - 1)

Dim string_format As New StringFormat
string_format.A lignment = StringAlignment .Center
string_format.L ineAlignment = StringAlignment .Center
string_format.F ormatFlags = _
StringFormatFla gs.DirectionVer tical Or _
StringFormatFla gs.DirectionRig htToLeft

e.Graphics.Draw String(txt, the_font, Brushes.Red, layout_rect,
string_format)
End Sub

http://www.java2s.com/Code/VB/2D/Dra...onVertical.htm

Mar 21 '07 #2
awesome, thanks!

"Charlie Brown" <cb****@duclaw. comwrote in message
news:11******** **************@ d57g2000hsg.goo glegroups.com.. .
On Mar 21, 1:45 pm, "Smokey Grindel" <nos...@nospam. comwrote:
>I want to draw a string that is at a 90 degree angle instead of left to
right it would be rotated 90 degrees... how would you go about doing
this?
thanks!

Private Sub Form1_Paint(ByV al sender As Object, ByVal e As
System.Windows. Forms.PaintEven tArgs) Handles MyBase.Paint
Dim txt As String = "www.java2s.com "
Dim the_font As New Font("Times New Roman", 30,
FontStyle.Bold, GraphicsUnit.Pi xel)
Dim layout_rect As New RectangleF(0, 0, _
Me.ClientSize.W idth - 1, Me.ClientSize.H eight - 1)

Dim string_format As New StringFormat
string_format.A lignment = StringAlignment .Center
string_format.L ineAlignment = StringAlignment .Center
string_format.F ormatFlags = _
StringFormatFla gs.DirectionVer tical Or _
StringFormatFla gs.DirectionRig htToLeft

e.Graphics.Draw String(txt, the_font, Brushes.Red, layout_rect,
string_format)
End Sub

http://www.java2s.com/Code/VB/2D/Dra...onVertical.htm

Mar 21 '07 #3

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

Similar topics

19
5749
by: George Ziniewicz | last post by:
.. I try to use CSS when possible, though I am still learning and don't maximize its use. In particular, I still use a table to provide for a centered image in a few slideshows (though table vertical align doesn't work in Mozilla): http://zintel.com/homepics.html I've used combinations of <center>, style align 'center', table cell align, valign and height='100%' to get what I want, but I wonder if CSS can do it by itself.
27
9257
by: FL | last post by:
Hi Everyone, I know howto center a block using margin-left: auto ; margin-right: auto ; but I'm trying to center vertically a box, any idea to solve this?
10
26875
by: john T | last post by:
Is there anyway to vertically center a html table using css in such a way it does not alter the html table. When I tryied it just screws up.
4
7372
by: Val | last post by:
When I am using Graphics.DrawString, I can only draw a string either horizontally or vertically. Is the a way to draw under arbitrary angle - parallel to some line? I would appreciate a code sample. Thanks, Val
5
5043
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page that calls the web service to render a vertical strip of images. After doing some research I am unable to find some vb.net code that can assist in what I want to achieve. The closest thing I found was
18
2165
by: ILCSP | last post by:
Hi, I just started learning Visual Basic (VB.NET 03) and I need to do this small program that will read a text file we get from another company that has survey data, parse it and flatten it out and make single strings out of the records in it. The major difference between this space delimited file from the many examples in these groups is that the data is not presented horizontally, but vertically. You can see an example below. What I...
2
2190
by: marss | last post by:
The text for the chart Y-axis title is to be drawn vertically. Here is the snippet of my code. ..... StringFormat drawFormat = new StringFormat(); drawFormat.FormatFlags = StringFormatFlags.DirectionVertical ; //g is object of type System.Drawing.Graphics g.DrawString("Period", font, Brushes.Black, 10, 10, drawFormat); ..... Standard functionality allows to do that but the text is drawn from the
1
2074
by: --== Alain ==-- | last post by:
Hi, I have a question about drawing windowed control. For example, i have a windowed control, let's called it C1 (as container for example). its width = 300 px and height = 200 px. C1 displays some other windowed controls, however, not all are displayed initially when C1 is painted. for example C2 can be located on point
1
1156
by: ollickle | last post by:
Hi, I joined as I wanted to draw a single dot. A line x,y,x,y draws nothing. A line x,y,x,y+1 draws two dots vertically. A line x,y+1,x+1,y+1 draws two dots horizontally,( like a capital L with the line above.) So change the dot color to match the background, then all that is left is the desired dot at x,y
0
9641
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
10313
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9944
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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
7494
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
6735
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
5378
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...
1
4044
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
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.