I'm trying to render DXF with transparent background, but
I can't do it. (saving later as GIF file)
Can anyone give me some hints how to do it?
I tried to do it with YxxfPrtViewHandler but it didn't give satisfied effects
I have done this with satisfactory results using the Acme.com gif routines. You will need to set the background color to #00000000 to get a transparent background. (The parameter is of the form: bgcolor=#aarrggbb where the "aa" is the transparency.) I assume you have seen the file doc/Ycad_api_readme1_a.txt which shows how to render a drawing to an arbitrary Java Graphics object. The document is not as complete and clear as it should be but it does have code fragments that show how to do this. I have also used this technique to render a drawing to a pdf file using the iText library (also on SourceForge).
Thank's a lot Ed Karlo for help with transparent background
I' ve made function which generates GIF file with
one layer with transparent background
It works fine for one layer.
I have problems with memory while creating GIF for each
layer in one loop because of using Threads by Ycad
I wonder if it is possible to synchronize it somehow
or stop using Thread without changing source files of
This is the code of the method
public void saveAsGIF(String l)
BufferedImage big = new BufferedImage(800, 600, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = big.createGraphics();
this.layerOn(l); // making layer visible
YxxfPrtViewHandler vhandler = new YxxfPrtViewHandler();
vhandler = new YxxfPrtViewHandler();
this.layerOff(l); // making layer invisible
Then using Acme.com gif routines I generate GIF file
Changing the drawing and/or shutting down the threads has never been implemented properly. Kind of a holdover from when this was first written - as a simple Applet to display just one drawing in a web page. This has been on my ToDo list and I have also had a request to look into this from someone else. This would be a good change and I will take a look at it over the next couple of days.
you said " I have also used this technique to render a drawing to a pdf file using the iText library (also on SourceForge)"
Can you please help me doing the same thing?
I readed the doc file but I've not understood howto fill a com.itext.Document object with a dwg using ycad..
Thank you very much.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.