Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
drawstring
- Page 1
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Month Ago
by toneewa
…ball.getRadius()); } // Display the collisionCount g.setColor(Color.black); g.
drawString
("Collision Count: " + collisionCount, 20, 20); g…;X: " + b.get(1).getX(), 180, 20); g.
drawString
("Y: " + b.get(1).getY(), 220, 20); } }…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Month Ago
by toneewa
…(i).getRadius()); } // display the collisionCount g.setColor(Color.black); g.
drawString
("Collision Count: " + collisionCount, 20, 20); } } Frame.java: import…
Re: drawString to object
Programming
Software Development
14 Years Ago
by AndreiDMS
…writes paintComponent() method: [CODE] public void paintComponent(Graphics g){ g.
drawString
(text, x, y); // draw 1 string } [/CODE] …= x+3; y = y + 6; // modify position g.
drawString
(text, x, y); [/CODE] then you are right, you will… 2 different positions(even if you call g.
drawString
twice without modifying any parameter you will have …
drawString to object
Programming
Software Development
14 Years Ago
by Olliepop
Hey guys How can i make instances of
drawString
editable? For example changing their x, y and value? Do i use variables for example [CODE=java]g.
drawString
(str1, x1, y1);[/CODE] Will the change be reflected as soon as i change the values of the variables? Thanks very much for your time!
Re: drawString to object
Programming
Software Development
14 Years Ago
by Olliepop
[QUOTE=AndreiDMS;1111081]No, in java all parameters are passed by value, so changing only x,y values will do nothing, you have to call g.
drawString
again.[/QUOTE] Wouldn't that just draw a completely new
drawString
though? How do i edit one i have already created?
Drawstring() not clear
Programming
Software Development
10 Years Ago
by castajiz_2
…); angle++; sz = e.Graphics.MeasureString(theString, this.Font); e.Graphics.
DrawString
(theString, this.Font, Brushes.Black,-(sz.Width/2),-(sz.Height…/2)); } I dont understand the last part with the
DrawString
(). The 2 last arguments of the method specify the location…
DrawString("A"...) to Object?
Programming
Software Development
10 Years Ago
by castajiz_2
… wondering is there any way to put my e.Graphics.
DrawString
() method into a variable(object) so that i can do… objects, but is there anyway to do that with the
drawstring
() already? I hope that i was clear enough.
Re: DrawString("A"...) to Object?
Programming
Software Development
10 Years Ago
by Ketsuekiame
I suggest you create an object that records coordinates and rotation. Inside that object let it have its own
drawstring
method that calls the `Graphics.
DrawString
` method. That way you can keep track of it. Not sure there is any other way to do it and methods themselves cannot be objects.
Re: drawString to object
Programming
Software Development
14 Years Ago
by AndreiDMS
No, in java all parameters are passed by value, so changing only x,y values will do nothing, you have to call g.
drawString
again.
Re: drawString to object
Programming
Software Development
14 Years Ago
by Olliepop
So do you suggest i use variables in the
drawString
parameters, and then repaint the interface the same way i painted it?
Re: drawString to object
Programming
Software Development
14 Years Ago
by AndreiDMS
[QUOTE=Olliepop;1111205]So do you suggest i use variables in the
drawString
parameters, and then repaint the interface the same way i painted it?[/QUOTE] Yes
Re: DrawString("A"...) to Object?
Programming
Software Development
10 Years Ago
by castajiz_2
… = paper.MeasureString(theString, stringFont); paper.RotateTransform(rtangle); rtangle += 10; paper.
DrawString
(theString, stringFont, new SolidBrush(Color.Blue), -(float)sz.Width / 2…
Re: DrawString("A"...) to Object?
Programming
Software Development
10 Years Ago
by castajiz_2
… ll make a class with some properties(coordinates) and the
drawstring
method that you mentioned. I know that you can not…
Drawstring doesn t rotate as it should
Programming
Software Development
10 Years Ago
by castajiz_2
….TranslateTransform(- (float)far.Width / 2, -(float)far.Height / 2); paper.
DrawString
(a, stringFont, Brushes.Black,new PointF(100,100)); } private void…
Help with drawString() method for multiplication applet
Programming
Software Development
14 Years Ago
by BobbieJean
… int number2 = rand.nextInt(9) + 1; brush.
drawString
(right, 20, 80); repaint(); validate(); } else {… answer.setText(""); brush.
drawString
(wrong, 20, 80); repaint(); validate(); } } } ); …
printing a variable with page.drawString
Programming
Software Development
14 Years Ago
by Superfat
… to tack a variable onto the end of a print.
drawString
so it would show up like Text: <variable>…; Or: [CODE]page.
drawString
("Text: " object1, x, y);[/CODE] Where object1 is…
PLEASE HELP resetting drawString and random numbers
Programming
Software Development
14 Years Ago
by BobbieJean
… + 1; brush = getGraphics(); brush.setFont(font2); brush.
drawString
(right, 20, 120); validate(); } else { answer.setText(&…quot;"); brush = getGraphics(); brush.setFont(font2); brush.
drawString
(wrong, 20, 120); validate(); } } } ); } @…
Re: printing a variable with page.drawString
Programming
Software Development
14 Years Ago
by BestJewSinceJC
… to a String, just like the javadoc says for the
drawString
method. So you could put "I'm a String…
Problem with DrawString under Windows 7
Programming
Software Development
14 Years Ago
by Solmyr
…, size, etc. Looks like everything is ok when using standard
DrawString
method but, when I'm trying to do it under…
Re: Problem with DrawString under Windows 7
Programming
Software Development
14 Years Ago
by zortec
… you can do: 1) Use TextRenderer.DrawText() and not Graphics.
DrawString
() You did not specify if you were using .NET 2…
Re: Drawstring() not clear
Programming
Software Development
10 Years Ago
by Begginnerdev
As shown [here](http://msdn.microsoft.com/en-us/library/system.drawing.graphics.translatetransform.aspx); the TranslateTransform sets the new zero point of the drawing. When you call this you are setting the new zero point to the center of the screen. (1/2 sz.Width, 1/2 sz.Height). Therefore, when you tell it to draw the string at 5,6 it will …
Re: Drawstring() not clear
Programming
Software Development
10 Years Ago
by castajiz_2
Thank Sir i should have read about Translatetransform i wasn t aware that this method set s it up from zero. I more thing . How come -(sz.Width/2),-(sz.Height/2) results in a positive value not negative as it shoudl be? Otherwise you ve solved my problem
Re: Drawstring() not clear
Programming
Software Development
10 Years Ago
by Begginnerdev
If you think of your screen as a quadrant, it would have the y axis reversed. (X,Y) 0,0 | 1,0 | 2,0 | 3,0 | 0,1 | 1,1 | 2,1 | 3,1 | 0,2 | 1,2 | 2,2 | 3,2 | This being said, you see a positive value in debug because you are viewing the values before the interpreter sees the '-'
Re: Drawstring() not clear
Programming
Software Development
10 Years Ago
by castajiz_2
hah, youre unbeliveable , cheers.
Re: DrawString("A"...) to Object?
Programming
Software Development
10 Years Ago
by Ketsuekiame
Can you provide an example of what you're doing in code? I don't quite understand you.
Re: DrawString("A"...) to Object?
Programming
Software Development
10 Years Ago
by castajiz_2
Posting again here i m done with this so i will mark this trhead as solved. I created a class for my object wich pick s up letters and i ve created a class for my letters and the thing that solved the main problem were the properties where i checked if there is a collision. I hate object oriented programming at first but now i love it and i can see…
Re: Drawstring doesn t rotate as it should
Programming
Software Development
10 Years Ago
by ddanbe
Perhaps it helps a bit if you have a look at [this](http://www.daniweb.com/software-development/csharp/code/227743/animation-rotate-a-string-with-a-timer)
DrawString does not work always
Programming
Software Development
11 Years Ago
by chordian12
hii, i am trying to create an image in which i am drawing a chess board with multiple colors and Drawing a string on it. but the string is not always drawn. sometimes it is drawing half charecter. I hv tried AddString it also doesnt work. plz help it is really urgent... regards
Re: DrawString does not work always
Programming
Software Development
11 Years Ago
by Momerath
Can you post your OnDraw code?
Re: DrawString does not work always
Programming
Software Development
11 Years Ago
by ddanbe
Analogy: Supose I have a car that starts, but I tell you it won’t bring me from point A to point B. Would you know what was wrong? Could you solve my problem? Supose I would send you a picture of my not working car and you would immediately notice that it was missing four wheels? You could tell me that, problem solved. Right? Why don’t you do the …
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC