Cropping SWT image [message #330172] |
Fri, 18 July 2008 05:25 |
Eclipse User |
|
|
|
Originally posted by: puneet82sri.yahoo.com
Hi All,
I have a application on draw2d, with different diagram. I need to save those diagram in images and then place them on msword. I am facing two problems.
1. I need to <b>save the big diagrams in parts</b> so that they can easily fit in msword page. <u>Drawing the complete draw2d figure</u> on Graphics is <u>expensive.</u>
2. Secondly we can export images only in BMP & JEPG. <b>BMP is too heavy</b> and placing JEPG bring dithering. Is there any other format to which we can save the images e.g. PNG.
Please comment
Thanks
Puneet
|
|
|
Re: Cropping SWT image [message #330182 is a reply to message #330172] |
Fri, 18 July 2008 13:02 |
Eclipse User |
|
|
|
Originally posted by: puneet82sri.yahoo.com
Hi All,
I have a work-around approach to achieve point 1.
AWT has apis to crop images.
1. Convert SWT image data into AWT's buffer.
2. Repeatedly crop awt buffer and convert them into swt's image data.
This approach seems to work fine. But for very big diagram I get memory exceptions. As I mentioned earlier -
<b>"Drawing the complete draw2d figure on Graphics is expensive."</b>.
Any one have an alternate, smart and efficient solution to it.
thanks
Puneet
|
|
|
Powered by
FUDForum. Page generated in 0.02712 seconds