kopia lustrzana https://github.com/njcrawford/EmbroideryReader
Updated for new paramaters to filterStitches() in PesFile.
rodzic
4ae7bec65e
commit
75dc0da0e8
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
Embridery Reader - an application to view .pes embroidery designs
|
||||
|
||||
Copyright (C) 2008 Nathan Crawford
|
||||
|
@ -54,5 +54,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.2.2.12")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.12")]
|
||||
[assembly: AssemblyVersion("1.2.2.19")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.19")]
|
||||
|
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -173,7 +173,8 @@ namespace embroideryReader
|
|||
{
|
||||
}
|
||||
}
|
||||
DrawArea = design.designToBitmap(threadThickness);
|
||||
int threshold = Convert.ToInt32(settings.getValue("filter stitches threshold"));
|
||||
DrawArea = design.designToBitmap(threadThickness, (settings.getValue("filter stitches") == "true"), threshold);
|
||||
panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
|
||||
panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
|
||||
panel1.Invalidate();
|
||||
|
@ -520,16 +521,19 @@ namespace embroideryReader
|
|||
{
|
||||
threadThickness = Convert.ToSingle(settings.getValue("thread thickness"));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
catch (Exception ex) { }
|
||||
}
|
||||
DrawArea = design.designToBitmap(threadThickness);
|
||||
int threshold = Convert.ToInt32(settings.getValue("filter stitches threshold"));
|
||||
DrawArea = design.designToBitmap(threadThickness, (settings.getValue("filter stitches") == "true"), threshold);
|
||||
panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
|
||||
panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
|
||||
panel1.Invalidate();
|
||||
|
||||
if (design.getFormatWarning())
|
||||
if (design.getClassWarning())
|
||||
{
|
||||
toolStripStatusLabel1.Text = "This file contains a class that is not yet supported";
|
||||
}
|
||||
else if (design.getFormatWarning())
|
||||
{
|
||||
toolStripStatusLabel1.Text = "The format of this file is not completely supported";
|
||||
}
|
||||
|
|
|
@ -62,11 +62,19 @@ namespace embroideryReader
|
|||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.txtThreadThickness = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.chkUglyStitches = new System.Windows.Forms.CheckBox();
|
||||
this.txtThreshold = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnColor
|
||||
//
|
||||
this.btnColor.Location = new System.Drawing.Point(148, 9);
|
||||
this.btnColor.Location = new System.Drawing.Point(171, 16);
|
||||
this.btnColor.Name = "btnColor";
|
||||
this.btnColor.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnColor.TabIndex = 0;
|
||||
|
@ -77,7 +85,7 @@ namespace embroideryReader
|
|||
// lblColor
|
||||
//
|
||||
this.lblColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.lblColor.Location = new System.Drawing.Point(12, 9);
|
||||
this.lblColor.Location = new System.Drawing.Point(6, 16);
|
||||
this.lblColor.Name = "lblColor";
|
||||
this.lblColor.Size = new System.Drawing.Size(130, 52);
|
||||
this.lblColor.TabIndex = 1;
|
||||
|
@ -86,7 +94,7 @@ namespace embroideryReader
|
|||
//
|
||||
// btnResetColor
|
||||
//
|
||||
this.btnResetColor.Location = new System.Drawing.Point(148, 38);
|
||||
this.btnResetColor.Location = new System.Drawing.Point(171, 45);
|
||||
this.btnResetColor.Name = "btnResetColor";
|
||||
this.btnResetColor.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnResetColor.TabIndex = 2;
|
||||
|
@ -97,7 +105,7 @@ namespace embroideryReader
|
|||
// btnOK
|
||||
//
|
||||
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.btnOK.Location = new System.Drawing.Point(67, 117);
|
||||
this.btnOK.Location = new System.Drawing.Point(171, 190);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOK.TabIndex = 3;
|
||||
|
@ -108,7 +116,7 @@ namespace embroideryReader
|
|||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(148, 117);
|
||||
this.btnCancel.Location = new System.Drawing.Point(252, 190);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 4;
|
||||
|
@ -119,7 +127,7 @@ namespace embroideryReader
|
|||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 74);
|
||||
this.label1.Location = new System.Drawing.Point(6, 16);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(92, 13);
|
||||
this.label1.TabIndex = 5;
|
||||
|
@ -127,7 +135,7 @@ namespace embroideryReader
|
|||
//
|
||||
// txtThreadThickness
|
||||
//
|
||||
this.txtThreadThickness.Location = new System.Drawing.Point(110, 71);
|
||||
this.txtThreadThickness.Location = new System.Drawing.Point(104, 13);
|
||||
this.txtThreadThickness.Name = "txtThreadThickness";
|
||||
this.txtThreadThickness.Size = new System.Drawing.Size(32, 20);
|
||||
this.txtThreadThickness.TabIndex = 6;
|
||||
|
@ -135,35 +143,96 @@ namespace embroideryReader
|
|||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(145, 74);
|
||||
this.label2.Location = new System.Drawing.Point(142, 16);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(33, 13);
|
||||
this.label2.TabIndex = 7;
|
||||
this.label2.Text = "pixels";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.lblColor);
|
||||
this.groupBox1.Controls.Add(this.btnColor);
|
||||
this.groupBox1.Controls.Add(this.btnResetColor);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(315, 79);
|
||||
this.groupBox1.TabIndex = 8;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Background";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Controls.Add(this.label3);
|
||||
this.groupBox2.Controls.Add(this.txtThreshold);
|
||||
this.groupBox2.Controls.Add(this.chkUglyStitches);
|
||||
this.groupBox2.Controls.Add(this.label1);
|
||||
this.groupBox2.Controls.Add(this.txtThreadThickness);
|
||||
this.groupBox2.Controls.Add(this.label2);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 97);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(315, 87);
|
||||
this.groupBox2.TabIndex = 3;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Stitch drawing";
|
||||
//
|
||||
// chkUglyStitches
|
||||
//
|
||||
this.chkUglyStitches.AutoSize = true;
|
||||
this.chkUglyStitches.Location = new System.Drawing.Point(9, 38);
|
||||
this.chkUglyStitches.Name = "chkUglyStitches";
|
||||
this.chkUglyStitches.Size = new System.Drawing.Size(131, 17);
|
||||
this.chkUglyStitches.TabIndex = 8;
|
||||
this.chkUglyStitches.Text = "Remove \'ugly\' stitches";
|
||||
this.chkUglyStitches.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// txtThreshold
|
||||
//
|
||||
this.txtThreshold.Location = new System.Drawing.Point(130, 55);
|
||||
this.txtThreshold.Name = "txtThreshold";
|
||||
this.txtThreshold.Size = new System.Drawing.Size(32, 20);
|
||||
this.txtThreshold.TabIndex = 9;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(168, 58);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(33, 13);
|
||||
this.label3.TabIndex = 10;
|
||||
this.label3.Text = "pixels";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(57, 58);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(67, 13);
|
||||
this.label4.TabIndex = 11;
|
||||
this.label4.Text = "Ugly Length:";
|
||||
//
|
||||
// frmSettingsDialog
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(234, 152);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.txtThreadThickness);
|
||||
this.Controls.Add(this.label1);
|
||||
this.ClientSize = new System.Drawing.Size(339, 225);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.btnResetColor);
|
||||
this.Controls.Add(this.lblColor);
|
||||
this.Controls.Add(this.btnColor);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmSettingsDialog";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Embroidery Reader Settings";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
@ -178,5 +247,11 @@ namespace embroideryReader
|
|||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox txtThreadThickness;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox txtThreshold;
|
||||
private System.Windows.Forms.CheckBox chkUglyStitches;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
|
@ -77,6 +77,24 @@ namespace embroideryReader
|
|||
{
|
||||
txtThreadThickness.Text = "5";
|
||||
}
|
||||
|
||||
if (settings.getValue("filter stitches") == "true")
|
||||
{
|
||||
chkUglyStitches.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
chkUglyStitches.Checked = false;
|
||||
}
|
||||
|
||||
if (settings.getValue("filter stitches threshold") != null)
|
||||
{
|
||||
txtThreshold.Text= settings.getValue("filter stitches threshold");
|
||||
}
|
||||
else
|
||||
{
|
||||
txtThreshold.Text = "120";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,6 +175,27 @@ namespace embroideryReader
|
|||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
|
||||
if (chkUglyStitches.Checked)
|
||||
{
|
||||
settings.setValue("filter stitches", "true");
|
||||
}
|
||||
else
|
||||
{
|
||||
settings.setValue("filter stitches", "false");
|
||||
}
|
||||
|
||||
int threshold = 120;
|
||||
try
|
||||
{
|
||||
threshold = Convert.ToInt32(txtThreshold.Text);
|
||||
if (threshold < 10)
|
||||
{
|
||||
threshold = 10;
|
||||
}
|
||||
settings.setValue("filter stitches threshold", threshold.ToString());
|
||||
}
|
||||
catch (Exception ex) { }
|
||||
}
|
||||
}
|
||||
}
|
Ładowanie…
Reference in New Issue