hello,
1、CreateImageForSingleFile, SaveGerberFileToImageUnsafe, when BoardLayer.Outline
if (State.Layer == BoardLayer.Outline)
{
// PLS.PreCombinePolygons = true;
// forcezero = true;
}
if (FileType == BoardFileType.Drill)
{
PLS = PolyLineSet.LoadExcellonDrillFile(log, GerberFilename); ;
}
else
{
PLS = PolyLineSet.LoadGerberFile(log, GerberFilename, forcezero, Gerber.WriteSanitized, State);
}
double WidthInMM = PLS.BoundingBox.BottomRight.X - PLS.BoundingBox.TopLeft.X;
double HeightInMM = PLS.BoundingBox.BottomRight.Y - PLS.BoundingBox.TopLeft.Y;
int Width = (int)(Math.Ceiling((WidthInMM) * (dpi / 25.4)));
int Height = (int)(Math.Ceiling((HeightInMM) * (dpi / 25.4)));
PLS.BoundingBox

2、GIC.WriteImageFiles, DrawBoard, when BoardLayer.Outline
scale = dpi / 25.4d; // dpi
var OutlineBoundingBox = GetOutlineBoundingBox();
double bw = Math.Abs(OutlineBoundingBox.BottomRight.X - OutlineBoundingBox.TopLeft.X);
double bh = Math.Abs(OutlineBoundingBox.BottomRight.Y - OutlineBoundingBox.TopLeft.Y);
int width = (int)((bw * scale));
int height = (int)((bh * scale));
//if (width > scale * 100) width = (int)(scale * 100);
//if (height > scale * 100) height = (int)(scale * 100);
int w = width + 3;
int h = height + 3;
same Outline file ,value different,pic w and h different,why?
hello,
1、CreateImageForSingleFile, SaveGerberFileToImageUnsafe, when BoardLayer.Outline
if (State.Layer == BoardLayer.Outline)
{
// PLS.PreCombinePolygons = true;
// forcezero = true;
}
if (FileType == BoardFileType.Drill)
{
PLS = PolyLineSet.LoadExcellonDrillFile(log, GerberFilename); ;
}
else
{
PLS = PolyLineSet.LoadGerberFile(log, GerberFilename, forcezero, Gerber.WriteSanitized, State);
}
double WidthInMM = PLS.BoundingBox.BottomRight.X - PLS.BoundingBox.TopLeft.X;
double HeightInMM = PLS.BoundingBox.BottomRight.Y - PLS.BoundingBox.TopLeft.Y;
int Width = (int)(Math.Ceiling((WidthInMM) * (dpi / 25.4)));
int Height = (int)(Math.Ceiling((HeightInMM) * (dpi / 25.4)));
PLS.BoundingBox

2、GIC.WriteImageFiles, DrawBoard, when BoardLayer.Outline
scale = dpi / 25.4d; // dpi
var OutlineBoundingBox = GetOutlineBoundingBox();
double bw = Math.Abs(OutlineBoundingBox.BottomRight.X - OutlineBoundingBox.TopLeft.X);
double bh = Math.Abs(OutlineBoundingBox.BottomRight.Y - OutlineBoundingBox.TopLeft.Y);
int width = (int)((bw * scale));
int height = (int)((bh * scale));
//if (width > scale * 100) width = (int)(scale * 100);
//if (height > scale * 100) height = (int)(scale * 100);
int w = width + 3;
int h = height + 3;
same Outline file ,value different,pic w and h different,why?