About convert dwg to png background and line color
Moderators: SDS, support, admin
About convert dwg to png background and line color
Hi, I try convert dwg to png,
sample code:
the result show white background and black line as follows
dwg file in DWG TrueView show black background and white line as follows
I want to export png that all colors are same as show in DWG TrueView
I try add
the result png background color is black, and line is still black.
how do I export png that all colors as same as dwg in DWG TrueView?
is CAD.NET auto change line color according to background color?
sample code:
Code: Select all
CADImage cadImage = CADImage.CreateImageByExtension(sourceFile);
cadImage.LoadFromFile(sourceFile);
DRect boundaryRectangle = new DRect(left, top, width, height);
Rectangle rect = new Rectangle(left, top, width, height);
cadImage.SaveToFile(outFileName, ImageFormat.Png, boundaryRectangle, rect);
I try add
Code: Select all
cadImage.BackgroundColor = Color.Black;
how do I export png that all colors as same as dwg in DWG TrueView?
is CAD.NET auto change line color according to background color?
Re: About convert dwg to png background and line color
Hello,
CAD .NET doesn't change the objects color automatically, depending on the background color. You will need to adjust the default color for objects and the background color before saving to a file, as follows:
Mikhail
CAD .NET doesn't change the objects color automatically, depending on the background color. You will need to adjust the default color for objects and the background color before saving to a file, as follows:
Code: Select all
cadImage.Painter.Settings.BackgroundColor = Color.Black.ToArgb();
cadImage.Painter.Settings.DefaultColor = Color.White.ToArgb();
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support