CADImport V8.0 - Missing entities dxf --> png
Posted: 18 Jun 2013, 16:42
Hello,
currently we face the problem, that when we try to generate a png image out of an dxf file several entities will not be shown/rendered.
The project is an c# WPF Project (.NET 4.0)
We are using at the moment the CAD Import .NET 8.0.0.30472 library.
Previously imported dxf files worked well. When i am using the ABViewer all entities are properly shown.
Is there a way that you could have a look on it?
The implementation is something like that:
CADImage cadImage = CADImage.CreateImageByExtension(fileName);
cadImage.Converter.SHXSettings.UseSHXFonts = false;
cadImage.Converter.SHXSettings.UseMultyTTFFonts = true;
cadImage.Converter.SHXSettings.UseTTFFonts = true;
cadImage.IsShowLineWeight = true;
cadImage.DefaultColor = Color.Black;
cadImage.BackgroundColor = Color.Transparent;
cadImage.GraphicsOutMode = DrawGraphicsMode.WPF;
cadImage.InterpolationMode = InterpolationMode.HighQualityBicubic;
if (CADConst.IsWebPath(fileName))
{
cadImage.LoadFromWeb(fileName);
}
else
{
cadImage.LoadFromFile(fileName);
}
using (var stream = new MemoryStream())
{
double pixelsize = Resolution;
var rect = new DRect {Width = pixelsize, Height = pixelsize};
cadImage.ChangeGraphicsMode(DrawGraphicsMode.WPF, RenderMode.Points);
cadImage.SaveToStream(stream, ImageFormat.Tiff, rect);
stream.WriteTo(new FileStream("TestImage.tiff", FileMode.Create));
CadData = new CadItem();
CadData.DisplayImage = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()).Replace(".tmp", ".png");
CadData.Width = cadImage.Extents.Width;
CadData.Height = cadImage.Extents.Height;
CadData.TopLeft = cadImage.Extents.TopLeft;
using (var image = new Bitmap(stream))
{
image.Save(CadData.DisplayImage);
}
}
I also attached a dxf test file (which i modified with the ABViewer 9.0 demo version)
I also tested the CAD Import .NET 9 demo Version with the same result.
Thanks in advance and best regards
currently we face the problem, that when we try to generate a png image out of an dxf file several entities will not be shown/rendered.
The project is an c# WPF Project (.NET 4.0)
We are using at the moment the CAD Import .NET 8.0.0.30472 library.
Previously imported dxf files worked well. When i am using the ABViewer all entities are properly shown.
Is there a way that you could have a look on it?
The implementation is something like that:
CADImage cadImage = CADImage.CreateImageByExtension(fileName);
cadImage.Converter.SHXSettings.UseSHXFonts = false;
cadImage.Converter.SHXSettings.UseMultyTTFFonts = true;
cadImage.Converter.SHXSettings.UseTTFFonts = true;
cadImage.IsShowLineWeight = true;
cadImage.DefaultColor = Color.Black;
cadImage.BackgroundColor = Color.Transparent;
cadImage.GraphicsOutMode = DrawGraphicsMode.WPF;
cadImage.InterpolationMode = InterpolationMode.HighQualityBicubic;
if (CADConst.IsWebPath(fileName))
{
cadImage.LoadFromWeb(fileName);
}
else
{
cadImage.LoadFromFile(fileName);
}
using (var stream = new MemoryStream())
{
double pixelsize = Resolution;
var rect = new DRect {Width = pixelsize, Height = pixelsize};
cadImage.ChangeGraphicsMode(DrawGraphicsMode.WPF, RenderMode.Points);
cadImage.SaveToStream(stream, ImageFormat.Tiff, rect);
stream.WriteTo(new FileStream("TestImage.tiff", FileMode.Create));
CadData = new CadItem();
CadData.DisplayImage = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()).Replace(".tmp", ".png");
CadData.Width = cadImage.Extents.Width;
CadData.Height = cadImage.Extents.Height;
CadData.TopLeft = cadImage.Extents.TopLeft;
using (var image = new Bitmap(stream))
{
image.Save(CadData.DisplayImage);
}
}
I also attached a dxf test file (which i modified with the ABViewer 9.0 demo version)
I also tested the CAD Import .NET 9 demo Version with the same result.
Thanks in advance and best regards