Mark Kahrl

Greenhorn
+ Follow
since Oct 01, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Kahrl

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
13 years ago
I have a java.awt canvas and frame that renders graphics. It appears fine when it renders, but when I try to save the buffered image to a file or print it, the image appears all black or solid color, works fine on Windows machines, but for some reason I get an all black buffered image when running the code on Mac OS X. The following code creates the buffered image:


Has any one had similar problems with a BufferedImage on OS X, please let me know. Thanks!

Mark
[ UD: added code tags for better legibility ]
[ October 02, 2007: Message edited by: Ulf Dittmer ]
13 years ago