• 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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!