kopia lustrzana https://github.com/njcrawford/EmbroideryReader
Some minor cosmetic bugfixes,, added save design as image functionality, corrected embroideryTester project name.
rodzic
72a41e1d97
commit
4fa575d7a4
|
@ -1,4 +1,4 @@
|
|||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.2.1.61")]
|
||||
[assembly: AssemblyFileVersion("1.2.1.61")]
|
||||
[assembly: AssemblyVersion("1.2.2.12")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.12")]
|
||||
|
|
Plik binarny nie jest wyświetlany.
|
@ -28,6 +28,7 @@ namespace embroideryReader
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
|
||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
|
@ -59,6 +60,10 @@ namespace embroideryReader
|
|||
this.printDocument1 = new System.Drawing.Printing.PrintDocument();
|
||||
this.printDialog1 = new System.Windows.Forms.PrintDialog();
|
||||
this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
|
||||
this.saveAsBitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
|
@ -93,6 +98,7 @@ namespace embroideryReader
|
|||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.openToolStripMenuItem,
|
||||
this.saveAsBitmapToolStripMenuItem,
|
||||
this.toolStripSeparator2,
|
||||
this.printToolStripMenuItem,
|
||||
this.printPreviewToolStripMenuItem,
|
||||
|
@ -105,20 +111,20 @@ namespace embroideryReader
|
|||
// openToolStripMenuItem
|
||||
//
|
||||
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
|
||||
this.openToolStripMenuItem.Text = "Open...";
|
||||
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(157, 6);
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(167, 6);
|
||||
//
|
||||
// printToolStripMenuItem
|
||||
//
|
||||
this.printToolStripMenuItem.Enabled = false;
|
||||
this.printToolStripMenuItem.Name = "printToolStripMenuItem";
|
||||
this.printToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.printToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
|
||||
this.printToolStripMenuItem.Text = "Print...";
|
||||
this.printToolStripMenuItem.Click += new System.EventHandler(this.printToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -126,19 +132,19 @@ namespace embroideryReader
|
|||
//
|
||||
this.printPreviewToolStripMenuItem.Enabled = false;
|
||||
this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
|
||||
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
|
||||
this.printPreviewToolStripMenuItem.Text = "Print Preview...";
|
||||
this.printPreviewToolStripMenuItem.Click += new System.EventHandler(this.printPreviewToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(157, 6);
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(167, 6);
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
|
||||
this.exitToolStripMenuItem.Text = "Exit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -186,7 +192,7 @@ namespace embroideryReader
|
|||
//
|
||||
this.rotateLeftToolStripMenuItem.Enabled = false;
|
||||
this.rotateLeftToolStripMenuItem.Name = "rotateLeftToolStripMenuItem";
|
||||
this.rotateLeftToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
|
||||
this.rotateLeftToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.rotateLeftToolStripMenuItem.Text = "Rotate left";
|
||||
this.rotateLeftToolStripMenuItem.Click += new System.EventHandler(this.rotateLeftToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -194,7 +200,7 @@ namespace embroideryReader
|
|||
//
|
||||
this.rotateRightToolStripMenuItem.Enabled = false;
|
||||
this.rotateRightToolStripMenuItem.Name = "rotateRightToolStripMenuItem";
|
||||
this.rotateRightToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
|
||||
this.rotateRightToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.rotateRightToolStripMenuItem.Text = "Rotate right";
|
||||
this.rotateRightToolStripMenuItem.Click += new System.EventHandler(this.rotateRightToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -202,7 +208,7 @@ namespace embroideryReader
|
|||
//
|
||||
this.refreshToolStripMenuItem.Enabled = false;
|
||||
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
|
||||
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
|
||||
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.refreshToolStripMenuItem.Text = "Reset";
|
||||
this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -221,7 +227,7 @@ namespace embroideryReader
|
|||
// checkForUpdateToolStripMenuItem
|
||||
//
|
||||
this.checkForUpdateToolStripMenuItem.Name = "checkForUpdateToolStripMenuItem";
|
||||
this.checkForUpdateToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
|
||||
this.checkForUpdateToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||
this.checkForUpdateToolStripMenuItem.Text = "Check for update";
|
||||
this.checkForUpdateToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdateToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -229,7 +235,7 @@ namespace embroideryReader
|
|||
//
|
||||
this.saveDebugInfoToolStripMenuItem.Enabled = false;
|
||||
this.saveDebugInfoToolStripMenuItem.Name = "saveDebugInfoToolStripMenuItem";
|
||||
this.saveDebugInfoToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
|
||||
this.saveDebugInfoToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||
this.saveDebugInfoToolStripMenuItem.Text = "Save design debug info";
|
||||
this.saveDebugInfoToolStripMenuItem.Click += new System.EventHandler(this.saveDebugInfoToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -237,19 +243,19 @@ namespace embroideryReader
|
|||
//
|
||||
this.showDebugInfoToolStripMenuItem.Enabled = false;
|
||||
this.showDebugInfoToolStripMenuItem.Name = "showDebugInfoToolStripMenuItem";
|
||||
this.showDebugInfoToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
|
||||
this.showDebugInfoToolStripMenuItem.Text = "Show debug info";
|
||||
this.showDebugInfoToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||
this.showDebugInfoToolStripMenuItem.Text = "Show design debug info";
|
||||
this.showDebugInfoToolStripMenuItem.Click += new System.EventHandler(this.showDebugInfoToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(194, 6);
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(196, 6);
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||
this.aboutToolStripMenuItem.Text = "About";
|
||||
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
|
||||
//
|
||||
|
@ -266,7 +272,8 @@ namespace embroideryReader
|
|||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripStatusLabel1});
|
||||
this.toolStripStatusLabel1,
|
||||
this.toolStripStatusLabel2});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 356);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(572, 22);
|
||||
|
@ -297,6 +304,25 @@ namespace embroideryReader
|
|||
this.printPreviewDialog1.Name = "printPreviewDialog1";
|
||||
this.printPreviewDialog1.Visible = false;
|
||||
//
|
||||
// saveAsBitmapToolStripMenuItem
|
||||
//
|
||||
this.saveAsBitmapToolStripMenuItem.Name = "saveAsBitmapToolStripMenuItem";
|
||||
this.saveAsBitmapToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.saveAsBitmapToolStripMenuItem.Text = "Save as image...";
|
||||
this.saveAsBitmapToolStripMenuItem.Click += new System.EventHandler(this.saveAsBitmapToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripStatusLabel2
|
||||
//
|
||||
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
|
||||
this.toolStripStatusLabel2.Size = new System.Drawing.Size(557, 17);
|
||||
this.toolStripStatusLabel2.Spring = true;
|
||||
this.toolStripStatusLabel2.Text = "status label";
|
||||
this.toolStripStatusLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// frmMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -353,6 +379,10 @@ namespace embroideryReader
|
|||
private System.Windows.Forms.ToolStripMenuItem rotateLeftToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem rotateRightToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem showDebugInfoToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveAsBitmapToolStripMenuItem;
|
||||
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -192,6 +192,10 @@ namespace embroideryReader
|
|||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
string filename;
|
||||
if (settings.getValue("last open file folder") != null)
|
||||
{
|
||||
openFileDialog1.InitialDirectory = settings.getValue("last open file folder");
|
||||
}
|
||||
openFileDialog1.FileName = "";
|
||||
openFileDialog1.Filter = "Embroidery Files (*.pes)|*.pes|All Files (*.*)|*.*";
|
||||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
|
@ -203,6 +207,7 @@ namespace embroideryReader
|
|||
}
|
||||
else
|
||||
{
|
||||
settings.setValue("last open file folder", System.IO.Path.GetDirectoryName(filename));
|
||||
openFile(filename);
|
||||
}
|
||||
}
|
||||
|
@ -383,28 +388,28 @@ namespace embroideryReader
|
|||
|
||||
//private void Form1_ResizeEnd(object sender, EventArgs e)
|
||||
//{
|
||||
//panel2.Top = 32;
|
||||
//panel2.Left = 0;
|
||||
//panel2.Height = this.Height - 50;
|
||||
//panel2.Width = this.Width - 50;
|
||||
//panel2.Top = 32;
|
||||
//panel2.Left = 0;
|
||||
//panel2.Height = this.Height - 50;
|
||||
//panel2.Width = this.Width - 50;
|
||||
//}
|
||||
|
||||
//private void Form1_Resize(object sender, EventArgs e)
|
||||
//{
|
||||
//panel2.Height = this.Height - 75;
|
||||
//panel2.Width = this.Width-8;
|
||||
//sizePanel2();
|
||||
//panel2.Height = this.Height - 75;
|
||||
//panel2.Width = this.Width-8;
|
||||
//sizePanel2();
|
||||
//}
|
||||
|
||||
//private void sizePanel2()
|
||||
//{
|
||||
//panel2.Height = this.Height - 73;
|
||||
//panel2.Width = this.Width - 8;
|
||||
//panel2.Height = this.Height - (statusStrip1.Height + menuStrip1.Height + 33);
|
||||
//panel2.Top = menuStrip1.Bottom;
|
||||
//panel2.Height = statusStrip1.Top - menuStrip1.Bottom;
|
||||
//panel2.Width = this.Width - 8;
|
||||
//panel2.Width = panel3.Right;
|
||||
//panel2.Height = this.Height - 73;
|
||||
//panel2.Width = this.Width - 8;
|
||||
//panel2.Height = this.Height - (statusStrip1.Height + menuStrip1.Height + 33);
|
||||
//panel2.Top = menuStrip1.Bottom;
|
||||
//panel2.Height = statusStrip1.Top - menuStrip1.Bottom;
|
||||
//panel2.Width = this.Width - 8;
|
||||
//panel2.Width = panel3.Right;
|
||||
//}
|
||||
|
||||
private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -519,7 +524,7 @@ namespace embroideryReader
|
|||
|
||||
private void rotateLeftToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Bitmap temp = new Bitmap(DrawArea.Height,DrawArea.Width);
|
||||
Bitmap temp = new Bitmap(DrawArea.Height, DrawArea.Width);
|
||||
Graphics g = Graphics.FromImage(temp);
|
||||
g.RotateTransform(270.0f);
|
||||
g.DrawImage(DrawArea, -DrawArea.Width, 0);
|
||||
|
@ -564,5 +569,54 @@ namespace embroideryReader
|
|||
MessageBox.Show("No design loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
private void saveAsBitmapToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (DrawArea != null)
|
||||
{
|
||||
Bitmap temp = new Bitmap(DrawArea.Width, DrawArea.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
||||
|
||||
Graphics tempGraph = Graphics.FromImage(temp);
|
||||
tempGraph.FillRectangle(Brushes.White, 0, 0, temp.Width, temp.Height);
|
||||
tempGraph.DrawImageUnscaled(DrawArea, 0, 0);
|
||||
tempGraph.Dispose();
|
||||
saveFileDialog1.FileName = "";
|
||||
saveFileDialog1.Filter = "Bitmap (*.bmp)|*.bmp|PNG (*.png)|*.png|JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif|All Files (*.*)|*.*";
|
||||
if (settings.getValue("last save image location") != null)
|
||||
{
|
||||
saveFileDialog1.InitialDirectory = settings.getValue("last save image location");
|
||||
}
|
||||
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string filename = "";
|
||||
filename = saveFileDialog1.FileName;
|
||||
System.Drawing.Imaging.ImageFormat format;
|
||||
switch (System.IO.Path.GetExtension(filename).ToLower())
|
||||
{
|
||||
case ".bmp": format = System.Drawing.Imaging.ImageFormat.Bmp; break;
|
||||
case ".png": format = System.Drawing.Imaging.ImageFormat.Png; break;
|
||||
case ".jpg": format = System.Drawing.Imaging.ImageFormat.Jpeg; break;
|
||||
case ".gif": format = System.Drawing.Imaging.ImageFormat.Gif; break;
|
||||
case ".tif": format = System.Drawing.Imaging.ImageFormat.Tiff; break;
|
||||
default: format = System.Drawing.Imaging.ImageFormat.Bmp; break;
|
||||
}
|
||||
temp.Save(filename, format);
|
||||
showStatus("Image saved", 5000);
|
||||
settings.setValue("last save image location", System.IO.Path.GetDirectoryName(filename));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void showStatus(string text, int msec)
|
||||
{
|
||||
toolStripStatusLabel2.Text = text;
|
||||
timer1.Interval = msec;
|
||||
timer1.Enabled = true;
|
||||
}
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
toolStripStatusLabel2.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -309,6 +309,12 @@
|
|||
wf+0BQAAgAUAAIAFAACAAQAAgAHB/4ABAACAAQAAgAEAALwBAAC8AQAAvAHB/4ABbP///5H/
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>760, 17</value>
|
||||
</metadata>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>888, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>43</value>
|
||||
</metadata>
|
||||
|
|
|
@ -51,6 +51,7 @@ namespace embroideryReader
|
|||
//
|
||||
// lblColor
|
||||
//
|
||||
this.lblColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.lblColor.Location = new System.Drawing.Point(12, 9);
|
||||
this.lblColor.Name = "lblColor";
|
||||
this.lblColor.Size = new System.Drawing.Size(130, 52);
|
||||
|
|
Ładowanie…
Reference in New Issue