Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

BufferedImage problem Mac OS X  RSS feed

 
Mark Kahrl
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a problem with a BufferedImage that only occurs on Mac OS X (Java 1.5), works fine on Windows. I have a frame that renders some graphics, it renders fine , but when I try to get a BufferedImage to save the control as a .jpg or to print it, the image is always all black. Here's the code works fine on Windows, the BufferedImage is all black for Mac OS X no matter what:

BufferedImage image=null;
Graphics2D g = (Graphics2D) this.getGraphics();
GraphicsConfiguration gc = g.getDeviceConfiguration();
image = gc.createCompatibleImage(width, height-20);
Graphics gg = image.getGraphics();
gg.translate(0, -50);
paint(gg);

Has anyone else had this type of problem on Mac OS X? Is there a work around? Thanks!

Mark
 
Joe Ess
Bartender
Posts: 9425
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!