URGENT: Textured filled geometric shapes are not printed when the shapes are large
posted 14 years ago
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)