graphical 'substrate'

J

Jeremy Watts

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.

thanks
jeremy watts
 
J

Joshua Cranmer

Jeremy said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top