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
1 answer
how to print 2 dimensional array on JFrame with drawString JAVA
I already have a main and a component to draw. Please help me fix this method.
public class ArrayMethod
{
private int i=8;
private int j=8;
private int[][]arrayMethod = {{0,0,0,0,0,0,0,0},
…

Leo Kao
- 39
- 8
0
votes
1 answer
Display printDocument before printing / How to define PoinF
I am using a PrintDialog and PrintDocument in c# windows application, WinForms, to print a document.
Printing working fine but I want to display the document before printing, so that I can check if PointF for DrawString is like I want it.How I can…

Del boy
- 97
- 1
- 14
0
votes
0 answers
Referencing a barcode font in graphics.drawstring VB
How can I go about referencing a barcode font in graphics.drawstring?
This is my code so far. Its printing the text not the barcode:
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As…

Brownd92
- 75
- 1
- 11
0
votes
1 answer
Java graphics.drawString displays inconsistently on Frame using AWT
I was programming up a nice little utility and all was going well, but then I tried to add some labels. They showed up. Then I made them longer and they disappeared. I tried many experiments (repositioning, changing font, changing the order) but…

JayWH
- 1
- 2
0
votes
2 answers
Is it possible to fill a letter with the Graphics Class in c#?
I'm working on a project that makes it possible to draw objects on a map in c#. We make use of our own created True Typed Font (.ttf). The reason we do this is because users must be able to specify their own icons for objects if they want.
The font…

Vincent Hogendoorn
- 700
- 1
- 7
- 23
0
votes
1 answer
What is the total orientation of DrawString/DrawImage in c#
I would like to print a document out from my c# file but I don't know the total orientation for the size of paper. For example:
e.Graphics.DrawImage(newImage, 25, 25, newImage.Width, newImage.Height);
What does the "25" mean? And what is the total…

JoJo
- 1
- 1
0
votes
2 answers
How to center a string (using g.drawString) into the middle of the screen
I'm trying to find different ways of centering text within a main menu that I'm trying to create, but all the ways that I've tried centers the string from the first letter. Is there any way of determining the length of the string passed in and then…
0
votes
0 answers
LWJGL: Text line-break
In legacy LWJGL when you use (TrueTypeFont).drawString(xPos, yPos, "the text");, I now wonder if you can use line-breaks in the text(like: \n), or you will have to do one function call per row?

Rasmus G
- 11
- 1
0
votes
1 answer
SpriteBatch DrawString is Drawing the wrong Charracter
I have been working on an app for practicing and learning Japanese, for that reason I use characters outside of the English alphabet. I have recently updated the work I had done on the app moving it to a new solution to take advantage of the newer…

FrogHorn
- 1
- 1
0
votes
0 answers
Java drawString does not work within if-statement
I have a strange problem. The g.drawString() does not work within an if-statement. It does outside the if-statement. I have tried System.out.print("TEST") within the if-statement. This works. If I however, add the drawString method, only the…

Jos IJntema
- 7
- 3
0
votes
0 answers
Drawing out reversed Strings with Graphics.drawString
What I want to do is printing out Numbers as a String via Graphics.drawString.
They will be the scale for an coordinate system which looks like this:
As you can see its reversed, negative numbers in positive y-direction and positve in negative…

Zi1mann
- 334
- 1
- 2
- 15
0
votes
0 answers
how to override the paint method without stopping its functionality
So my assignment wants me to create an applet but as an extra I'm supposed to use the paint method to draw a string, for example:
public void paint(Graphics g){
g.drawString("name, name name", 400,100);
}
My problem is that this…
user4747724
0
votes
0 answers
drawString method not displaying text
I have looked through Google searches and a few online tutorials and I am still stuck. It seems unfortunately I am stuck using AWT to do this assignment, seeing as Swing would be better. My assignment is to draw a die.
Currently I am stuck just…

Sujkaa
- 1
- 1
0
votes
1 answer
How can i determine the width of a drawn string?
I'm drawing a string using the following:
g.DrawString(somestring, somefont, new SolidBrush(Color.Black), X where it starts, Y where it starts));
Problem:
Sometimes I want to align the drawn string on the left side of a line.
But, it doesn't work…

ng80092b
- 621
- 1
- 9
- 24
0
votes
0 answers
DrawString align right
How would I go about aligning my text to the right side using DrawString.
I want to have it look like this
______1 st
instead of
1______ st
note:
"st" is from a second drawstring
_ is used as placeholder for empty space, not existing in the…

maam27
- 444
- 3
- 21