Graphics.DrawString is a method in the .Net Framework's System.Drawing namespace, by which code can draw text onto an image in .Net code. This is mainly used in ASP.Net, as TextRenderer.DrawText (from System.Windows.Forms) provides more reliable functionality in Windows Forms applications.
Questions tagged [drawstring]
313 questions
0
votes
2 answers
centering individual letters in a vertical string in java
Okay so I have a vertical string but when it contains I's or L's they are offset from the rest of the string because of how they are typographically written they are in a sense left justified in the box they are drawn in unlike the rest are drawn…

staticFlow
- 141
- 1
- 2
- 13
0
votes
1 answer
C# progressbar drawstring on form load
is there a way to write a default text on a progressbar in C# ?
this isn't working in Form_Load, but works fine on button click...
using (Graphics gr = progressBar1.CreateGraphics())
{
StringFormat sf = new…

BaKeMoNo
- 1
- 1
0
votes
0 answers
draw listview columns and alignment the columns seperatly
i am drawing my listview before i print it and i can align columns to the right with StringAlignment.Far but it draws all column to the right, can i draw my first description column to the left and price column to the right?
if…

marda
- 1
0
votes
1 answer
DrawString across multiple JPanels within a JFrame
I've got somePanel1, somePanel2, and somePanel3 instantiated within someFrame.
If I do a drawString in somePanel form, how can I get the output to be different in somePanel1, somePanel2, and somePanel3.
For instance g.drawString("X", x, y); puts an…

Toto Nyoob
- 1
- 1
0
votes
2 answers
How do I use nonstatic methods?
I have been searching for a while, and the documentation nor Google return a good answer. I just started using java, so help me out here. I am getting an error with
Graphics.drawString('hello',10, 10);
However all the documentation is telling me is…

Groditz
- 115
- 12
0
votes
1 answer
How does spriteBatch.DrawString draw text from compiled spritesheet texture?
Does each spriteBatch.DrawString(spriteFont, "text", new Vector2(10, 20), Color.White) call draw every letter of the text string separately (calls spriteBatch.Draw for each letter each frame), or does it make one texture and redraws it, or does it…

user1306322
- 8,561
- 18
- 61
- 122
0
votes
2 answers
Using DrawString to top align text
I want to use DrawString to vertically align text with different size fonts. Basically I am trying to print a sell price on a report with the cents printed in a smaller font than than the dollars. This is in a report engine and I need to write to an…

Jeff - Software Results
- 762
- 7
- 25
0
votes
2 answers
How can I draw things using this Java GUI API?
My instructor has defined this API for graphics.
It's very simple but I've spent an hour or two now trying to figure out how to make simple Graphics manipulations show up.
So I have a class T which extends TopLevel and it is my main frame. I also…

jaynp
- 3,275
- 4
- 30
- 43
0
votes
1 answer
DrawString only works in top-left part of form vb.net
Here is my code
Public Class Form1
Public MyFormObject As Graphics = Me.CreateGraphics
Public objFont = New System.Drawing.Font("arial", 20)
Public a, b As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As…

WillumMaguire
- 537
- 2
- 10
- 21
0
votes
1 answer
Change the color of a String using DrawString?
I'm in vb.net and I'm trying to format a print document. One of the non-negotiable attributes of it in one corner I have to a have a string with a black background and white text. I'm trying to use the DrawString and I can change the brush color ,…

Brandon
- 915
- 4
- 23
- 44
0
votes
2 answers
Draw string on ellipse
I'm happy with the output of my clock, however - I am not sure how to properly align my drawString for the numbers which should appear at the tip of each tick mark on the clock.
I am hoping someone might be able show the proper method/formula for…

Kairan
- 5,342
- 27
- 65
- 104
0
votes
0 answers
Why repainting of that take so much time?
I have something like that (the time is now displayed correctly). I have added KeyListener to the JFrame in which these JPanels are. When I press ->(right key) I want to time to increment by one and it does but it is really slow(like 3 seconds of…

Yoda
- 17,363
- 67
- 204
- 344
0
votes
2 answers
Change color during writing a string into an image with drawstring
I'm creating a string out of three smaller strings which I read in from three different text-files and then write the string into an image. I'd like to change the color for the paragraph in the middle of a created image. I can create the image with…

Airlike
- 233
- 2
- 6
- 14
0
votes
1 answer
Character style influenced by background while painting it with Graphics.DrawString() (.NET 4.0)
Background: I am working on a legacy map application using WinForms and .NET4.0. The labels, roads, icons are painted to a separate bitmap called "overlay" apart from the terrain. The background of the overlay is transparent and later will be…

user256890
- 3,396
- 5
- 28
- 45
0
votes
2 answers
Justify text with DrawString right -and- left
Let's say I have 200 pixels of space and I want to draw two strings into it:
- the first string should be left justified
- right second string should be right justified
- But not overlap if they do not both fit (then do whatever my…

Dave
- 1,521
- 17
- 31