Results 1 to 2 of 2
- 10-05-2012, 11:48 PM #1
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
What solution (of these 2) is the fastest way to paint in graphics?
I need to max out the speed of the repainting of some widgets.
So I'm making my own widget system that only contains the things that I need so that it dont calculate unnessecary stuff.
Anyhow, these two solutions both draw same pattern, but which is fastest?
1
2Java Code:g.drawRect(X, Y, width, height); g.drawLine(X+1, 20, X+width-2, 20);
In number 2 I draw a line that intersects two pixels with the drawn rectangle.Java Code:g.drawRect(X, Y, width, height); g.drawLine(X, 20, X+width, 20);
In number one I remove those two pixels of intersection but at the cost of calculating a new x value twice.'
Which one is the preferred and fastest way to draw this pattern?
- 10-05-2012, 11:58 PM #2
Re: What solution (of these 2) is the fastest way to paint in graphics?
I really don't think you're going to see a major difference in either one. But if you're worried about it, you're going to have to benchmark it for yourself within your own context.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Using Graphics outside of a paint method
By Catfish1 in forum New To JavaReplies: 6Last Post: 10-26-2010, 08:57 PM -
paint in vector graphics
By koddy in forum New To JavaReplies: 7Last Post: 06-16-2010, 08:30 AM -
Two JPanels and paint(Graphics)
By ingfy in forum New To JavaReplies: 3Last Post: 04-27-2010, 08:51 PM -
print variable with paint(Graphics g) ??
By tghn2b in forum New To JavaReplies: 10Last Post: 12-29-2008, 12:11 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks