Hello,
I’m presently working on a program that can be permit us to verify if our product is conform about the drawing. In fact, i need to convert my Dxf file to JPEG or PNG file. However when i launch my c# program, it works but the the JPEG file is blank. Can you help me to understand what’is my problem and how can i resolve it please ?
This is my code :
public String Convert_to_png(string numero)
{
string element_t = “”;
// Load a CAD drawing in an instance of Image
using (var image = Aspose.CAD.Image.Load(numero))
{
// Create an instance of CadRasterizationOptions
var rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
// Set image width & height
rasterizationOptions.PageWidth = 1600;
rasterizationOptions.PageHeight = 1600;
rasterizationOptions.AutomaticLayoutsScaling = true;
rasterizationOptions.NoScaling = false;
rasterizationOptions.DrawType = Aspose.CAD.FileFormats.Cad.CadDrawTypeMode.UseDrawColor;
rasterizationOptions.DrawColor = Aspose.CAD.Color.Black;
// Set the drawing to render at the center of image
rasterizationOptions.AutomaticLayoutsScaling = true;
// Create an instance of JpegOptions (or any ImageOptions for raster formats)
var options = new Aspose.CAD.ImageOptions.JpegOptions();
// Set VectorRasterizationOptions property to the instance of CadRasterizationOptions
options.VectorRasterizationOptions = rasterizationOptions;
//Export each layer to Jpeg format
String name = numero + ".jpg";
image.Save(name, options);
element_t = "ok";
}
return element_t;
}<a class="attachment" href="/uploads/default/54163">317602cor_01_flat.zip</a> (2.9 KB)