wood burning stoves 2.0*
The moose likes Java in General and the fly likes URGENT: Textured filled geometric shapes are not printed when the shapes are large Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "URGENT: Textured filled geometric shapes are not printed when the shapes are large" Watch "URGENT: Textured filled geometric shapes are not printed when the shapes are large" New topic
Author

URGENT: Textured filled geometric shapes are not printed when the shapes are large

Tanveer Rameez
Ranch Hand

Joined: Dec 11, 2000
Posts: 158
hello
I have a strange problem. I have a frame where I paint a filled rectangle. Now if I print it, it prints fine(the printing may need several pages if the rectangle is large).
But if I use TexturePaint to fill the rectangle with texture(tiled image), the printing is fine for small rectangle, but hangs when the rectangle is large.
When I clicked on the printer icon that appears in the taskbar in Windows to display the printing status dialog, I found that the temporary file created in the buffer for printing is huge(can be upto 10MB!!) if I use texture and the size is much smaller if I don't use texture (just fill the rectangle by color). So I guess because of the huge size of the buffer file, the printing is not possible(the file did not go to the printer).
Can anybody tell me what is the problem and how to solve it.
Actually my program will fill several geometric shapes which may span several pages.
here is a sample code. Just copy and save it in a file "testframe.java" and run it. You must have a printer to check it out. Then click on the printer icon to see the file size. Ofcourse the problem may be something else .

I think the problem might be because when I use an image(I used 48x48 pixel image which is small), to texturepaint, the image object is copied several times for tiling, thereby requiring large memory. Let me know is there any solution to it.If now is there any other way to texture paint/fill or tile any large shape(my shapes can be irregular too, like area of intersection between two irregular polygons) and print them.
Thanks in advance
regards
Tanveer


Author of JPhotoBrush Pro (www.jphotobrushpro.com)
 
Don't get me started about those stupid light bulbs.
 
subject: URGENT: Textured filled geometric shapes are not printed when the shapes are large
 
Similar Threads
Wanted: Java2D example of zooming and panning with scroll bars
Problem in printing Jpanel Data
Using TexturePaint causes printing problem
TexturePaint Object
Printing: How to disable doubleBuffering on Graphics2D?