Try to match printer resolution when printing a design

Branch_2.1.x
Nathan Crawford 2015-04-17 00:32:06 -04:00
rodzic 0d4ec463f2
commit 0705e4b456
1 zmienionych plików z 4 dodań i 6 usunięć

Wyświetl plik

@ -450,13 +450,11 @@ namespace embroideryReader
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
if (DrawArea != null)
if (design != null)
{
float dpiX = 100;
float dpiY = 100;
double inchesPerMM = 0.03937007874015748031496062992126;
e.Graphics.ScaleTransform((float)(dpiX * inchesPerMM * 0.1), (float)(dpiY * inchesPerMM * 0.1));
Bitmap tempDrawArea = design.designToBitmap((float)settings.threadThickness, (settings.filterStiches), settings.filterStitchesThreshold, 1.0f);
float inchesPerMM = 0.03937007874015748031496062992126f;
e.Graphics.ScaleTransform((float)(e.PageSettings.PrinterResolution.X * inchesPerMM * 0.01f), (float)(e.PageSettings.PrinterResolution.Y * inchesPerMM * 0.01f));
Bitmap tempDrawArea = design.designToBitmap((float)settings.threadThickness, settings.filterStiches, settings.filterStitchesThreshold, e.PageSettings.PrinterResolution.X * inchesPerMM * 0.2f);
e.Graphics.DrawImage(tempDrawArea, 30, 30);
}
}