Results 1 to 4 of 4
Thread: drawing images in swing
- 05-09-2011, 03:11 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 4
- Rep Power
- 0
drawing images in swing
Hi everyone,
I need to draw an image on another imagein a JPanel:
public void paint(graphics g){
super.paint(g);
Graphics2D g2d = (Graphics2D)g;
g2d.drawImage(board, 110, 130, this);
g2d.drawImage(pebble,122,140,this);
}
where pebble is an image to be drawn on image board.
My problem is the background of pebble appears on the image board when drawn on it.How would I make the background of pebble image disappear?
The images are all .png types.
Thanks
- 05-09-2011, 03:22 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 339
- Rep Power
- 13
- 05-09-2011, 03:26 PM #3
Member
- Join Date
- Feb 2011
- Posts
- 4
- Rep Power
- 0
forgive my bad grammar...i want to make the background transparent so that it does not appear.thanks
- 05-09-2011, 03:27 PM #4
Similar Threads
-
Drawing a selection box using swing
By edi233 in forum AWT / SwingReplies: 6Last Post: 05-09-2011, 04:16 PM -
Help drawing images for pong game
By aalsaqri in forum New To JavaReplies: 4Last Post: 05-28-2010, 03:10 PM -
Using Images in Swing
By Chasingxsuns in forum New To JavaReplies: 5Last Post: 08-01-2009, 01:22 AM -
drawing images
By diggitydoggz in forum New To JavaReplies: 4Last Post: 01-02-2009, 04:15 AM -
Default Swing Images
By Bubba_OH in forum New To JavaReplies: 5Last Post: 10-10-2008, 04:00 PM
Bookmarks