Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image background color

 
ramnna jain
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying the below code to draw image with setting background color white.
The generated image is an image with black background.

How to overcome this problem?



 
ramnna jain
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried and getting desired result:


 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm no expert in graphics, but I would think that Graphics#clearRect(int x, int y, int width, int height) would be a better choice for filling a region with a background color.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic