Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Programmer > Re: graphical '...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 52647 of 55513
Post > Topic >>

Re: graphical 'substrate'

by Joshua Cranmer <Pidgeot18@[EMAIL PROTECTED] > May 11, 2008 at 06:01 PM

Jeremy Watts wrote:
> is it possible in java graphics to draw 'over' an existing graphic as
> if it werent there?  a background graphic in other words, similar to a
> background picture on the windows desktop.
> 
> what i am after is a 'graph paper' type background effect with the
> rulings of the graph paper lines visible in the background, and then
> the ability to draw over that as if it were blank.
> 
> how would you do this sort of thing in java?  sorry if the question
> seems rudimentary but i am new to java graphics.

As is so often the case, there are several ways to do this. I don't know 
which one would necessarily be the best one to use for your situation, 
but I will list the ones that come to my mind:

1. If you're mostly doing Graphics.drawLine, etc., then you can start 
the painting procedure by drawing the graph paper lines and then proceed 
to draw the rest of the stuff on top of that.

2. If the graphics is complex with different components, then providing 
a special container pane with the lines would be better. Be sure to 
check that the child panes are transparent though.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth
 




 2 Posts in Topic:
graphical 'substrate'
Jeremy Watts <jwatts19  2008-05-11 10:29:24 
Re: graphical 'substrate'
Joshua Cranmer <Pidgeo  2008-05-11 18:01:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 20:08:39 CST 2008.