Set eol and mime type properties that were wiped out during repository split

Branch_1.5.0
Nathan Crawford 2009-06-18 17:19:06 +00:00
rodzic 29a507ac05
commit a9ff7b58ab
21 zmienionych plików z 3247 dodań i 3247 usunięć

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,59 +1,59 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PesFile")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PesFile")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f0f809da-4d68-4682-aed3-c8c38979e509")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PesFile")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PesFile")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f0f809da-4d68-4682-aed3-c8c38979e509")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

Wyświetl plik

@ -1,73 +1,73 @@
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace embroideryInfo
{
class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
try
{
if (args[0] == "--image" && args.Length > 1)
{
PesFile.PesFile design = new PesFile.PesFile(args[1]);
Bitmap DrawArea = design.designToBitmap(5, false, 0);
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();
temp.Save(System.IO.Path.ChangeExtension(args[1], ".png"));
}
else
{
PesFile.PesFile design = new PesFile.PesFile(args[0]);
design.saveDebugInfo();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
else
{
Console.WriteLine("Specify input file");
for (int x = 0; x < args.Length; x++)
{
Console.WriteLine(args[x]);
}
}
}
}
}
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace embroideryInfo
{
class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
try
{
if (args[0] == "--image" && args.Length > 1)
{
PesFile.PesFile design = new PesFile.PesFile(args[1]);
Bitmap DrawArea = design.designToBitmap(5, false, 0);
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();
temp.Save(System.IO.Path.ChangeExtension(args[1], ".png"));
}
else
{
PesFile.PesFile design = new PesFile.PesFile(args[0]);
design.saveDebugInfo();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
else
{
Console.WriteLine("Specify input file");
for (int x = 0; x < args.Length; x++)
{
Console.WriteLine(args[x]);
}
}
}
}
}

Wyświetl plik

@ -1,57 +1,57 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("embroideryInfo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("embroideryInfo")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4f0ed79b-33dc-4066-9a65-6d44d2b94332")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("embroideryInfo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("embroideryInfo")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4f0ed79b-33dc-4066-9a65-6d44d2b94332")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Wyświetl plik

@ -1,45 +1,45 @@
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace embroideryReader
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
}
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace embroideryReader
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
}
}

Wyświetl plik

@ -1,58 +1,58 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("embroideryReader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("embroideryReader")]
[assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3a23ec6d-56f8-4048-acae-0454abb9aa5f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.4.0.5")]
[assembly: AssemblyFileVersion("1.4.0.5")]
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("embroideryReader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("embroideryReader")]
[assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3a23ec6d-56f8-4048-acae-0454abb9aa5f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.4.0.5")]
[assembly: AssemblyFileVersion("1.4.0.5")]

Wyświetl plik

@ -1,96 +1,96 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryReader.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("embroideryReader.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryReader.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("embroideryReader.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

Wyświetl plik

@ -1,55 +1,55 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryReader.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryReader.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

Wyświetl plik

@ -1,413 +1,413 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
namespace embroideryReader
{
partial class frmMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </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();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsBitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rotateLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rotateRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkForUpdateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveDebugInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showDebugInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel2 = new System.Windows.Forms.Panel();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.printDocument1 = new System.Drawing.Printing.PrintDocument();
this.printDialog1 = new System.Windows.Forms.PrintDialog();
this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.menuStrip1.SuspendLayout();
this.panel2.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(44, 25);
this.panel1.TabIndex = 7;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.editToolStripMenuItem,
this.viewToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(572, 24);
this.menuStrip1.TabIndex = 8;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openToolStripMenuItem,
this.saveAsBitmapToolStripMenuItem,
this.toolStripSeparator2,
this.printToolStripMenuItem,
this.printPreviewToolStripMenuItem,
this.toolStripSeparator3,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.fileToolStripMenuItem.Text = "File";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.openToolStripMenuItem.Text = "Open...";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// saveAsBitmapToolStripMenuItem
//
this.saveAsBitmapToolStripMenuItem.Enabled = false;
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);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(163, 6);
//
// printToolStripMenuItem
//
this.printToolStripMenuItem.Enabled = false;
this.printToolStripMenuItem.Name = "printToolStripMenuItem";
this.printToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.printToolStripMenuItem.Text = "Print...";
this.printToolStripMenuItem.Click += new System.EventHandler(this.printToolStripMenuItem_Click);
//
// printPreviewToolStripMenuItem
//
this.printPreviewToolStripMenuItem.Enabled = false;
this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(166, 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(163, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyToolStripMenuItem,
this.toolStripSeparator4,
this.preferencesToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// copyToolStripMenuItem
//
this.copyToolStripMenuItem.Enabled = false;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(152, 6);
//
// preferencesToolStripMenuItem
//
this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
this.preferencesToolStripMenuItem.Text = "Preferences...";
this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.preferencesToolStripMenuItem_Click);
//
// viewToolStripMenuItem
//
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.rotateLeftToolStripMenuItem,
this.rotateRightToolStripMenuItem,
this.refreshToolStripMenuItem});
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
this.viewToolStripMenuItem.Size = new System.Drawing.Size(41, 20);
this.viewToolStripMenuItem.Text = "View";
//
// rotateLeftToolStripMenuItem
//
this.rotateLeftToolStripMenuItem.Enabled = false;
this.rotateLeftToolStripMenuItem.Name = "rotateLeftToolStripMenuItem";
this.rotateLeftToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.rotateLeftToolStripMenuItem.Text = "Rotate left";
this.rotateLeftToolStripMenuItem.Click += new System.EventHandler(this.rotateLeftToolStripMenuItem_Click);
//
// rotateRightToolStripMenuItem
//
this.rotateRightToolStripMenuItem.Enabled = false;
this.rotateRightToolStripMenuItem.Name = "rotateRightToolStripMenuItem";
this.rotateRightToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.rotateRightToolStripMenuItem.Text = "Rotate right";
this.rotateRightToolStripMenuItem.Click += new System.EventHandler(this.rotateRightToolStripMenuItem_Click);
//
// refreshToolStripMenuItem
//
this.refreshToolStripMenuItem.Enabled = false;
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.refreshToolStripMenuItem.Text = "Reset";
this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.checkForUpdateToolStripMenuItem,
this.saveDebugInfoToolStripMenuItem,
this.showDebugInfoToolStripMenuItem,
this.toolStripSeparator1,
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.helpToolStripMenuItem.Text = "Help";
//
// checkForUpdateToolStripMenuItem
//
this.checkForUpdateToolStripMenuItem.Name = "checkForUpdateToolStripMenuItem";
this.checkForUpdateToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.checkForUpdateToolStripMenuItem.Text = "Check for update";
this.checkForUpdateToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdateToolStripMenuItem_Click);
//
// saveDebugInfoToolStripMenuItem
//
this.saveDebugInfoToolStripMenuItem.Enabled = false;
this.saveDebugInfoToolStripMenuItem.Name = "saveDebugInfoToolStripMenuItem";
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);
//
// showDebugInfoToolStripMenuItem
//
this.showDebugInfoToolStripMenuItem.Enabled = false;
this.showDebugInfoToolStripMenuItem.Name = "showDebugInfoToolStripMenuItem";
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(196, 6);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// panel2
//
this.panel2.AutoScroll = true;
this.panel2.Controls.Add(this.panel1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 24);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(572, 332);
this.panel2.TabIndex = 10;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
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);
this.statusStrip1.TabIndex = 11;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.BackColor = System.Drawing.Color.Transparent;
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17);
//
// toolStripStatusLabel2
//
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(557, 17);
this.toolStripStatusLabel2.Spring = true;
this.toolStripStatusLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// printDocument1
//
this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
//
// printDialog1
//
this.printDialog1.UseEXDialog = true;
//
// printPreviewDialog1
//
this.printPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.printPreviewDialog1.ClientSize = new System.Drawing.Size(400, 300);
this.printPreviewDialog1.Enabled = true;
this.printPreviewDialog1.Icon = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon")));
this.printPreviewDialog1.Name = "printPreviewDialog1";
this.printPreviewDialog1.Visible = false;
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(572, 378);
this.Controls.Add(this.panel2);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Name = "frmMain";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.panel2.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem checkForUpdateToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.ToolStripMenuItem saveDebugInfoToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem preferencesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Drawing.Printing.PrintDocument printDocument1;
private System.Windows.Forms.PrintDialog printDialog1;
private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1;
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem refreshToolStripMenuItem;
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;
}
}
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
namespace embroideryReader
{
partial class frmMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </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();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsBitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rotateLeftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rotateRightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.checkForUpdateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveDebugInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showDebugInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel2 = new System.Windows.Forms.Panel();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.printDocument1 = new System.Drawing.Printing.PrintDocument();
this.printDialog1 = new System.Windows.Forms.PrintDialog();
this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.menuStrip1.SuspendLayout();
this.panel2.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(44, 25);
this.panel1.TabIndex = 7;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.editToolStripMenuItem,
this.viewToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(572, 24);
this.menuStrip1.TabIndex = 8;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openToolStripMenuItem,
this.saveAsBitmapToolStripMenuItem,
this.toolStripSeparator2,
this.printToolStripMenuItem,
this.printPreviewToolStripMenuItem,
this.toolStripSeparator3,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.fileToolStripMenuItem.Text = "File";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.openToolStripMenuItem.Text = "Open...";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// saveAsBitmapToolStripMenuItem
//
this.saveAsBitmapToolStripMenuItem.Enabled = false;
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);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(163, 6);
//
// printToolStripMenuItem
//
this.printToolStripMenuItem.Enabled = false;
this.printToolStripMenuItem.Name = "printToolStripMenuItem";
this.printToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.printToolStripMenuItem.Text = "Print...";
this.printToolStripMenuItem.Click += new System.EventHandler(this.printToolStripMenuItem_Click);
//
// printPreviewToolStripMenuItem
//
this.printPreviewToolStripMenuItem.Enabled = false;
this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(166, 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(163, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyToolStripMenuItem,
this.toolStripSeparator4,
this.preferencesToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// copyToolStripMenuItem
//
this.copyToolStripMenuItem.Enabled = false;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(152, 6);
//
// preferencesToolStripMenuItem
//
this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
this.preferencesToolStripMenuItem.Text = "Preferences...";
this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.preferencesToolStripMenuItem_Click);
//
// viewToolStripMenuItem
//
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.rotateLeftToolStripMenuItem,
this.rotateRightToolStripMenuItem,
this.refreshToolStripMenuItem});
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
this.viewToolStripMenuItem.Size = new System.Drawing.Size(41, 20);
this.viewToolStripMenuItem.Text = "View";
//
// rotateLeftToolStripMenuItem
//
this.rotateLeftToolStripMenuItem.Enabled = false;
this.rotateLeftToolStripMenuItem.Name = "rotateLeftToolStripMenuItem";
this.rotateLeftToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.rotateLeftToolStripMenuItem.Text = "Rotate left";
this.rotateLeftToolStripMenuItem.Click += new System.EventHandler(this.rotateLeftToolStripMenuItem_Click);
//
// rotateRightToolStripMenuItem
//
this.rotateRightToolStripMenuItem.Enabled = false;
this.rotateRightToolStripMenuItem.Name = "rotateRightToolStripMenuItem";
this.rotateRightToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.rotateRightToolStripMenuItem.Text = "Rotate right";
this.rotateRightToolStripMenuItem.Click += new System.EventHandler(this.rotateRightToolStripMenuItem_Click);
//
// refreshToolStripMenuItem
//
this.refreshToolStripMenuItem.Enabled = false;
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.refreshToolStripMenuItem.Text = "Reset";
this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.checkForUpdateToolStripMenuItem,
this.saveDebugInfoToolStripMenuItem,
this.showDebugInfoToolStripMenuItem,
this.toolStripSeparator1,
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.helpToolStripMenuItem.Text = "Help";
//
// checkForUpdateToolStripMenuItem
//
this.checkForUpdateToolStripMenuItem.Name = "checkForUpdateToolStripMenuItem";
this.checkForUpdateToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.checkForUpdateToolStripMenuItem.Text = "Check for update";
this.checkForUpdateToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdateToolStripMenuItem_Click);
//
// saveDebugInfoToolStripMenuItem
//
this.saveDebugInfoToolStripMenuItem.Enabled = false;
this.saveDebugInfoToolStripMenuItem.Name = "saveDebugInfoToolStripMenuItem";
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);
//
// showDebugInfoToolStripMenuItem
//
this.showDebugInfoToolStripMenuItem.Enabled = false;
this.showDebugInfoToolStripMenuItem.Name = "showDebugInfoToolStripMenuItem";
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(196, 6);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// panel2
//
this.panel2.AutoScroll = true;
this.panel2.Controls.Add(this.panel1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 24);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(572, 332);
this.panel2.TabIndex = 10;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
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);
this.statusStrip1.TabIndex = 11;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.BackColor = System.Drawing.Color.Transparent;
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17);
//
// toolStripStatusLabel2
//
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(557, 17);
this.toolStripStatusLabel2.Spring = true;
this.toolStripStatusLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// printDocument1
//
this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
//
// printDialog1
//
this.printDialog1.UseEXDialog = true;
//
// printPreviewDialog1
//
this.printPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.printPreviewDialog1.ClientSize = new System.Drawing.Size(400, 300);
this.printPreviewDialog1.Enabled = true;
this.printPreviewDialog1.Icon = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon")));
this.printPreviewDialog1.Name = "printPreviewDialog1";
this.printPreviewDialog1.Visible = false;
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(572, 378);
this.Controls.Add(this.panel2);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Name = "frmMain";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.panel2.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem checkForUpdateToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.ToolStripMenuItem saveDebugInfoToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem preferencesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Drawing.Printing.PrintDocument printDocument1;
private System.Windows.Forms.PrintDialog printDialog1;
private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1;
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem refreshToolStripMenuItem;
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;
}
}

Wyświetl plik

@ -1,497 +1,497 @@
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;
namespace embroideryReader
{
public partial class frmMain : Form
{
private string[] args;
private Pen drawPen = Pens.Black;
private Bitmap DrawArea;
private PesFile.PesFile design;
private nc_settings.IniFile settings = new nc_settings.IniFile("embroideryreader.ini");
public frmMain()
{
InitializeComponent();
args = Environment.GetCommandLineArgs();
}
private void checkSettings()
{
string updateLoc;
updateLoc = settings.getValue("update location");
if (String.IsNullOrEmpty(updateLoc) || updateLoc == "http://www.njcrawford.com/embreader/")
{
settings.setValue("update location", "http://www.njcrawford.com/embroidery-reader/");
}
if (settings.getValue("background color", "enabled") == "yes")
{
if (checkColorFromStrings(settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue")))
{
this.BackColor = makeColorFromStrings(settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue"));
}
else
{
this.BackColor = Color.FromKnownColor(KnownColor.Control);
}
}
else
{
this.BackColor = Color.FromKnownColor(KnownColor.Control);
}
}
private void Form1_Load(object sender, EventArgs e)
{
checkSettings();
this.Text = "Embroidery Reader";
if (args.Length > 1)
{
openFile(args[1]);
}
}
public static bool checkColorFromStrings(string red, string green, string blue)
{
byte redByte;
byte greenByte;
byte blueByte;
bool retval = false;
if (String.IsNullOrEmpty(red) || String.IsNullOrEmpty(green) || String.IsNullOrEmpty(blue))
{
retval = false;
}
else
{
try
{
redByte = Convert.ToByte(red);
greenByte = Convert.ToByte(green);
blueByte = Convert.ToByte(blue);
retval = true;
}
catch (Exception ex)
{
#if DEBUG
Console.WriteLine(ex.Message);
#endif
retval = false;
}
}
return retval;
}
public static Color makeColorFromStrings(string red, string green, string blue)
{
if (checkColorFromStrings(red, green, blue))
{
return Color.FromArgb(Convert.ToByte(red), Convert.ToByte(green), Convert.ToByte(blue));
}
else
{
return Color.Red;
}
}
private void openFile(string filename)
{
if (!System.IO.File.Exists(filename))
{
return;
}
design = new PesFile.PesFile(filename);
if (design.getStatus() == PesFile.statusEnum.Ready)
{
this.Text = System.IO.Path.GetFileName(filename) + " - Embroidery Reader";
//sizePanel2();
double threadThickness = 5;
if (!Double.TryParse(settings.getValue("thread thickness"), out threadThickness))
{
threadThickness = 5;
}
double threshold = 10;
if (!Double.TryParse(settings.getValue("filter stitches threshold"), out threshold))
{
threshold = 120;
}
DrawArea = design.designToBitmap((float)threadThickness, (settings.getValue("filter stitches") == "true"), (int)threshold);
panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
panel1.Invalidate();
if (design.getFormatWarning())
{
toolStripStatusLabel1.Text = "The format of this file is not completely supported";
}
else if (design.getColorWarning())
{
toolStripStatusLabel1.Text = "Colors shown for this design may be inaccurate";
}
else
{
toolStripStatusLabel1.Text = "";
}
copyToolStripMenuItem.Enabled = true;
saveDebugInfoToolStripMenuItem.Enabled = true;
printPreviewToolStripMenuItem.Enabled = true;
printToolStripMenuItem.Enabled = true;
rotateLeftToolStripMenuItem.Enabled = true;
rotateRightToolStripMenuItem.Enabled = true;
refreshToolStripMenuItem.Enabled = true;
showDebugInfoToolStripMenuItem.Enabled = true;
saveAsBitmapToolStripMenuItem.Enabled = true;
panel2.Select();
}
else
{
MessageBox.Show("An error occured while reading the file:" + Environment.NewLine + design.getLastError());
copyToolStripMenuItem.Enabled = false;
saveDebugInfoToolStripMenuItem.Enabled = false;
printPreviewToolStripMenuItem.Enabled = false;
printToolStripMenuItem.Enabled = false;
rotateLeftToolStripMenuItem.Enabled = false;
rotateRightToolStripMenuItem.Enabled = false;
refreshToolStripMenuItem.Enabled = false;
showDebugInfoToolStripMenuItem.Enabled = false;
saveAsBitmapToolStripMenuItem.Enabled = false;
}
}
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)
{
filename = openFileDialog1.FileName;
if (!System.IO.File.Exists(filename))
{
return;
}
else
{
settings.setValue("last open file folder", System.IO.Path.GetDirectoryName(filename));
openFile(filename);
}
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
if (DrawArea != null)
{
e.Graphics.DrawImage(DrawArea, 0, 0);
}
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("EmbroideryReader version " + currentVersion() + ". This program reads and displays embroidery designs from .PES files.");
}
private void checkForUpdateToolStripMenuItem_Click(object sender, EventArgs e)
{
nc_Updater.IniFileUpdater updater = new nc_Updater.IniFileUpdater(settings.getValue("update location"));
updater.waitForInfo();
// this shouldn't be able to happen, the update location is checked at form load
if(settings.getValue("update location") == null)
{
MessageBox.Show("Cannot check for update because the 'update location'" + Environment.NewLine + "setting has been removed from the settings file.");
}
else if (updater.IsUpdateAvailable())
{
if (MessageBox.Show("Version " + updater.VersionAvailable() + " is available." + Environment.NewLine + "You have version " + currentVersion() + ". Would you like to go to the Embroidery Reader website to download it?", "New version available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
System.Diagnostics.Process.Start(updater.getMoreInfoURL());
}
catch (Exception ex)
{
MessageBox.Show("An error occured while trying to open the webpage:" + Environment.NewLine + ex.ToString());
}
//if (!updater.InstallUpdate())
//{
// MessageBox.Show("Update failed, error message: " + updater.GetLastError());
//}
//else
//{
// Environment.Exit(0);
//}
}
}
else if (updater.GetLastError() != "")
{
MessageBox.Show("Encountered an error while checking for updates: " + updater.GetLastError());
}
else
{
MessageBox.Show("No updates are available right now." + Environment.NewLine + "(Latest version is " + updater.VersionAvailable() + ", you have version " + currentVersion() + ")");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
settings.save();
}
private string currentVersion()
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
private void saveDebugInfoToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design != null)
{
try
{
design.saveDebugInfo();
}
catch (Exception ex)
{
MessageBox.Show("There was an error while saving debug info:" + Environment.NewLine + ex.ToString());
}
}
else
{
MessageBox.Show("No design loaded.");
}
}
private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
{
frmSettingsDialog tempForm = new frmSettingsDialog();
tempForm.settings = settings;
if (tempForm.ShowDialog() == DialogResult.OK)
{
settings = tempForm.settings;
checkSettings();
}
}
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
if (printDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.Print();
}
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
if (DrawArea != null)
{
float dpiX = 100;
float dpiY = 100;
double mmPerInch = 0.03937007874015748031496062992126;
e.Graphics.ScaleTransform((float)(dpiX * mmPerInch * 0.1), (float)(dpiY * mmPerInch * 0.1));
e.Graphics.DrawImage(DrawArea, 30, 30);
}
}
private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
{
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
if (DrawArea != null)
{
Clipboard.Clear();
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();
Clipboard.SetImage(temp);
}
}
private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design != null && design.getStatus() == PesFile.statusEnum.Ready)
{
double threadThickness = 5;
if (!Double.TryParse(settings.getValue("thread thickness"), out threadThickness))
{
threadThickness = 5;
}
int threshold = Convert.ToInt32(settings.getValue("filter stitches threshold"));
DrawArea = design.designToBitmap((float)threadThickness, (settings.getValue("filter stitches") == "true"), (int)threshold);
panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
panel1.Invalidate();
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";
}
else if (design.getColorWarning())
{
toolStripStatusLabel1.Text = "Colors shown for this design may be inaccurate";
}
else
{
toolStripStatusLabel1.Text = "";
}
}
}
private void rotateLeftToolStripMenuItem_Click(object sender, EventArgs e)
{
Bitmap temp = new Bitmap(DrawArea.Height, DrawArea.Width);
Graphics g = Graphics.FromImage(temp);
g.RotateTransform(270.0f);
g.DrawImage(DrawArea, -DrawArea.Width, 0);
g.Dispose();
DrawArea = temp;
int temp2 = panel1.Width;
panel1.Width = panel1.Height;
panel1.Height = temp2;
panel1.Invalidate();
}
private void rotateRightToolStripMenuItem_Click(object sender, EventArgs e)
{
Bitmap temp = new Bitmap(DrawArea.Height, DrawArea.Width);
Graphics g = Graphics.FromImage(temp);
g.RotateTransform(90.0f);
g.DrawImage(DrawArea, 0, -DrawArea.Height);
g.Dispose();
DrawArea = temp;
int temp2 = panel1.Width;
panel1.Width = panel1.Height;
panel1.Height = temp2;
panel1.Invalidate();
}
private void showDebugInfoToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design != null)
{
try
{
frmTextbox theform = new frmTextbox();
theform.showText(design.getDebugInfo());
}
catch (Exception ex)
{
MessageBox.Show("There was an error while saving debug info:" + Environment.NewLine + ex.ToString());
}
}
else
{
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 = "";
}
}
}
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;
namespace embroideryReader
{
public partial class frmMain : Form
{
private string[] args;
private Pen drawPen = Pens.Black;
private Bitmap DrawArea;
private PesFile.PesFile design;
private nc_settings.IniFile settings = new nc_settings.IniFile("embroideryreader.ini");
public frmMain()
{
InitializeComponent();
args = Environment.GetCommandLineArgs();
}
private void checkSettings()
{
string updateLoc;
updateLoc = settings.getValue("update location");
if (String.IsNullOrEmpty(updateLoc) || updateLoc == "http://www.njcrawford.com/embreader/")
{
settings.setValue("update location", "http://www.njcrawford.com/embroidery-reader/");
}
if (settings.getValue("background color", "enabled") == "yes")
{
if (checkColorFromStrings(settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue")))
{
this.BackColor = makeColorFromStrings(settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue"));
}
else
{
this.BackColor = Color.FromKnownColor(KnownColor.Control);
}
}
else
{
this.BackColor = Color.FromKnownColor(KnownColor.Control);
}
}
private void Form1_Load(object sender, EventArgs e)
{
checkSettings();
this.Text = "Embroidery Reader";
if (args.Length > 1)
{
openFile(args[1]);
}
}
public static bool checkColorFromStrings(string red, string green, string blue)
{
byte redByte;
byte greenByte;
byte blueByte;
bool retval = false;
if (String.IsNullOrEmpty(red) || String.IsNullOrEmpty(green) || String.IsNullOrEmpty(blue))
{
retval = false;
}
else
{
try
{
redByte = Convert.ToByte(red);
greenByte = Convert.ToByte(green);
blueByte = Convert.ToByte(blue);
retval = true;
}
catch (Exception ex)
{
#if DEBUG
Console.WriteLine(ex.Message);
#endif
retval = false;
}
}
return retval;
}
public static Color makeColorFromStrings(string red, string green, string blue)
{
if (checkColorFromStrings(red, green, blue))
{
return Color.FromArgb(Convert.ToByte(red), Convert.ToByte(green), Convert.ToByte(blue));
}
else
{
return Color.Red;
}
}
private void openFile(string filename)
{
if (!System.IO.File.Exists(filename))
{
return;
}
design = new PesFile.PesFile(filename);
if (design.getStatus() == PesFile.statusEnum.Ready)
{
this.Text = System.IO.Path.GetFileName(filename) + " - Embroidery Reader";
//sizePanel2();
double threadThickness = 5;
if (!Double.TryParse(settings.getValue("thread thickness"), out threadThickness))
{
threadThickness = 5;
}
double threshold = 10;
if (!Double.TryParse(settings.getValue("filter stitches threshold"), out threshold))
{
threshold = 120;
}
DrawArea = design.designToBitmap((float)threadThickness, (settings.getValue("filter stitches") == "true"), (int)threshold);
panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
panel1.Invalidate();
if (design.getFormatWarning())
{
toolStripStatusLabel1.Text = "The format of this file is not completely supported";
}
else if (design.getColorWarning())
{
toolStripStatusLabel1.Text = "Colors shown for this design may be inaccurate";
}
else
{
toolStripStatusLabel1.Text = "";
}
copyToolStripMenuItem.Enabled = true;
saveDebugInfoToolStripMenuItem.Enabled = true;
printPreviewToolStripMenuItem.Enabled = true;
printToolStripMenuItem.Enabled = true;
rotateLeftToolStripMenuItem.Enabled = true;
rotateRightToolStripMenuItem.Enabled = true;
refreshToolStripMenuItem.Enabled = true;
showDebugInfoToolStripMenuItem.Enabled = true;
saveAsBitmapToolStripMenuItem.Enabled = true;
panel2.Select();
}
else
{
MessageBox.Show("An error occured while reading the file:" + Environment.NewLine + design.getLastError());
copyToolStripMenuItem.Enabled = false;
saveDebugInfoToolStripMenuItem.Enabled = false;
printPreviewToolStripMenuItem.Enabled = false;
printToolStripMenuItem.Enabled = false;
rotateLeftToolStripMenuItem.Enabled = false;
rotateRightToolStripMenuItem.Enabled = false;
refreshToolStripMenuItem.Enabled = false;
showDebugInfoToolStripMenuItem.Enabled = false;
saveAsBitmapToolStripMenuItem.Enabled = false;
}
}
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)
{
filename = openFileDialog1.FileName;
if (!System.IO.File.Exists(filename))
{
return;
}
else
{
settings.setValue("last open file folder", System.IO.Path.GetDirectoryName(filename));
openFile(filename);
}
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
if (DrawArea != null)
{
e.Graphics.DrawImage(DrawArea, 0, 0);
}
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("EmbroideryReader version " + currentVersion() + ". This program reads and displays embroidery designs from .PES files.");
}
private void checkForUpdateToolStripMenuItem_Click(object sender, EventArgs e)
{
nc_Updater.IniFileUpdater updater = new nc_Updater.IniFileUpdater(settings.getValue("update location"));
updater.waitForInfo();
// this shouldn't be able to happen, the update location is checked at form load
if(settings.getValue("update location") == null)
{
MessageBox.Show("Cannot check for update because the 'update location'" + Environment.NewLine + "setting has been removed from the settings file.");
}
else if (updater.IsUpdateAvailable())
{
if (MessageBox.Show("Version " + updater.VersionAvailable() + " is available." + Environment.NewLine + "You have version " + currentVersion() + ". Would you like to go to the Embroidery Reader website to download it?", "New version available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
System.Diagnostics.Process.Start(updater.getMoreInfoURL());
}
catch (Exception ex)
{
MessageBox.Show("An error occured while trying to open the webpage:" + Environment.NewLine + ex.ToString());
}
//if (!updater.InstallUpdate())
//{
// MessageBox.Show("Update failed, error message: " + updater.GetLastError());
//}
//else
//{
// Environment.Exit(0);
//}
}
}
else if (updater.GetLastError() != "")
{
MessageBox.Show("Encountered an error while checking for updates: " + updater.GetLastError());
}
else
{
MessageBox.Show("No updates are available right now." + Environment.NewLine + "(Latest version is " + updater.VersionAvailable() + ", you have version " + currentVersion() + ")");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
settings.save();
}
private string currentVersion()
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
private void saveDebugInfoToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design != null)
{
try
{
design.saveDebugInfo();
}
catch (Exception ex)
{
MessageBox.Show("There was an error while saving debug info:" + Environment.NewLine + ex.ToString());
}
}
else
{
MessageBox.Show("No design loaded.");
}
}
private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
{
frmSettingsDialog tempForm = new frmSettingsDialog();
tempForm.settings = settings;
if (tempForm.ShowDialog() == DialogResult.OK)
{
settings = tempForm.settings;
checkSettings();
}
}
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
if (printDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.Print();
}
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
if (DrawArea != null)
{
float dpiX = 100;
float dpiY = 100;
double mmPerInch = 0.03937007874015748031496062992126;
e.Graphics.ScaleTransform((float)(dpiX * mmPerInch * 0.1), (float)(dpiY * mmPerInch * 0.1));
e.Graphics.DrawImage(DrawArea, 30, 30);
}
}
private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
{
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
if (DrawArea != null)
{
Clipboard.Clear();
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();
Clipboard.SetImage(temp);
}
}
private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design != null && design.getStatus() == PesFile.statusEnum.Ready)
{
double threadThickness = 5;
if (!Double.TryParse(settings.getValue("thread thickness"), out threadThickness))
{
threadThickness = 5;
}
int threshold = Convert.ToInt32(settings.getValue("filter stitches threshold"));
DrawArea = design.designToBitmap((float)threadThickness, (settings.getValue("filter stitches") == "true"), (int)threshold);
panel1.Width = design.GetWidth() + (int)(threadThickness * 2);
panel1.Height = design.GetHeight() + (int)(threadThickness * 2);
panel1.Invalidate();
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";
}
else if (design.getColorWarning())
{
toolStripStatusLabel1.Text = "Colors shown for this design may be inaccurate";
}
else
{
toolStripStatusLabel1.Text = "";
}
}
}
private void rotateLeftToolStripMenuItem_Click(object sender, EventArgs e)
{
Bitmap temp = new Bitmap(DrawArea.Height, DrawArea.Width);
Graphics g = Graphics.FromImage(temp);
g.RotateTransform(270.0f);
g.DrawImage(DrawArea, -DrawArea.Width, 0);
g.Dispose();
DrawArea = temp;
int temp2 = panel1.Width;
panel1.Width = panel1.Height;
panel1.Height = temp2;
panel1.Invalidate();
}
private void rotateRightToolStripMenuItem_Click(object sender, EventArgs e)
{
Bitmap temp = new Bitmap(DrawArea.Height, DrawArea.Width);
Graphics g = Graphics.FromImage(temp);
g.RotateTransform(90.0f);
g.DrawImage(DrawArea, 0, -DrawArea.Height);
g.Dispose();
DrawArea = temp;
int temp2 = panel1.Width;
panel1.Width = panel1.Height;
panel1.Height = temp2;
panel1.Invalidate();
}
private void showDebugInfoToolStripMenuItem_Click(object sender, EventArgs e)
{
if (design != null)
{
try
{
frmTextbox theform = new frmTextbox();
theform.showText(design.getDebugInfo());
}
catch (Exception ex)
{
MessageBox.Show("There was an error while saving debug info:" + Environment.NewLine + ex.ToString());
}
}
else
{
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 = "";
}
}
}

Wyświetl plik

@ -1,257 +1,257 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
namespace embroideryReader
{
partial class frmSettingsDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.btnColor = new System.Windows.Forms.Button();
this.lblColor = new System.Windows.Forms.Label();
this.btnResetColor = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
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(171, 16);
this.btnColor.Name = "btnColor";
this.btnColor.Size = new System.Drawing.Size(75, 23);
this.btnColor.TabIndex = 0;
this.btnColor.Text = "Pick Color...";
this.btnColor.UseVisualStyleBackColor = true;
this.btnColor.Click += new System.EventHandler(this.btnColor_Click);
//
// lblColor
//
this.lblColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
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;
this.lblColor.Text = "Background Color";
this.lblColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnResetColor
//
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;
this.btnResetColor.Text = "Reset Color";
this.btnResetColor.UseVisualStyleBackColor = true;
this.btnResetColor.Click += new System.EventHandler(this.btnResetColor_Click);
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
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;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// label1
//
this.label1.AutoSize = true;
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;
this.label1.Text = "Thread thickness:";
//
// txtThreadThickness
//
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;
//
// label2
//
this.label2.AutoSize = true;
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(339, 225);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
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);
}
#endregion
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Button btnColor;
private System.Windows.Forms.Label lblColor;
private System.Windows.Forms.Button btnResetColor;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
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;
}
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
namespace embroideryReader
{
partial class frmSettingsDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.btnColor = new System.Windows.Forms.Button();
this.lblColor = new System.Windows.Forms.Label();
this.btnResetColor = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
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(171, 16);
this.btnColor.Name = "btnColor";
this.btnColor.Size = new System.Drawing.Size(75, 23);
this.btnColor.TabIndex = 0;
this.btnColor.Text = "Pick Color...";
this.btnColor.UseVisualStyleBackColor = true;
this.btnColor.Click += new System.EventHandler(this.btnColor_Click);
//
// lblColor
//
this.lblColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
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;
this.lblColor.Text = "Background Color";
this.lblColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnResetColor
//
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;
this.btnResetColor.Text = "Reset Color";
this.btnResetColor.UseVisualStyleBackColor = true;
this.btnResetColor.Click += new System.EventHandler(this.btnResetColor_Click);
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
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;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// label1
//
this.label1.AutoSize = true;
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;
this.label1.Text = "Thread thickness:";
//
// txtThreadThickness
//
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;
//
// label2
//
this.label2.AutoSize = true;
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(339, 225);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
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);
}
#endregion
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Button btnColor;
private System.Windows.Forms.Label lblColor;
private System.Windows.Forms.Button btnResetColor;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
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;
}
}

Wyświetl plik

@ -1,175 +1,175 @@
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace embroideryReader
{
public partial class frmSettingsDialog : Form
{
private bool colorChanged = false;
private nc_settings.IniFile _settings;
public nc_settings.IniFile settings
{
get
{
return _settings;
}
set
{
_settings = value;
if (settings.getValue("background color", "enabled") == "yes" &&
frmMain.checkColorFromStrings(
settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue")))
{
lblColor.BackColor = frmMain.makeColorFromStrings(
settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue"));
}
if (settings.getValue("thread thickness") != null)
{
double threadThickness = 1;
if (!Double.TryParse(settings.getValue("thread thickness"), out threadThickness))
{
threadThickness = 5;
}
if (threadThickness < 1)
{
threadThickness = 1;
}
txtThreadThickness.Text = threadThickness.ToString();
}
else
{
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";
}
}
}
public frmSettingsDialog()
{
InitializeComponent();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnColor_Click(object sender, EventArgs e)
{
colorDialog1.Color = lblColor.BackColor;
if (colorDialog1.ShowDialog() == DialogResult.OK && lblColor.BackColor != colorDialog1.Color)
{
lblColor.BackColor = colorDialog1.Color;
colorChanged = true;
}
}
private void btnResetColor_Click(object sender, EventArgs e)
{
if (lblColor.BackColor != Color.FromKnownColor(KnownColor.Control))
{
lblColor.BackColor = Color.FromKnownColor(KnownColor.Control);
colorChanged = true;
}
}
private void btnOK_Click(object sender, EventArgs e)
{
if (colorChanged)
{
if (lblColor.BackColor != Color.FromKnownColor(KnownColor.Control))
{
settings.setValue("background color", "enabled", "yes");
settings.setValue("background color", "red", lblColor.BackColor.R.ToString());
settings.setValue("background color", "green", lblColor.BackColor.G.ToString());
settings.setValue("background color", "blue", lblColor.BackColor.B.ToString());
}
else
{
settings.setValue("background color", "enabled", "no");
}
}
double threadThickness = 5;
if (Double.TryParse(txtThreadThickness.Text, out threadThickness))
{
if (threadThickness < 1)
{
threadThickness = 1;
}
settings.setValue("thread thickness", threadThickness.ToString());
}
if (chkUglyStitches.Checked)
{
settings.setValue("filter stitches", "true");
}
else
{
settings.setValue("filter stitches", "false");
}
double threshold = 120;
if (Double.TryParse(txtThreshold.Text, out threshold))
{
if (threshold < 10)
{
threshold = 10;
}
settings.setValue("filter stitches threshold", threshold.ToString());
}
}
}
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace embroideryReader
{
public partial class frmSettingsDialog : Form
{
private bool colorChanged = false;
private nc_settings.IniFile _settings;
public nc_settings.IniFile settings
{
get
{
return _settings;
}
set
{
_settings = value;
if (settings.getValue("background color", "enabled") == "yes" &&
frmMain.checkColorFromStrings(
settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue")))
{
lblColor.BackColor = frmMain.makeColorFromStrings(
settings.getValue("background color", "red"),
settings.getValue("background color", "green"),
settings.getValue("background color", "blue"));
}
if (settings.getValue("thread thickness") != null)
{
double threadThickness = 1;
if (!Double.TryParse(settings.getValue("thread thickness"), out threadThickness))
{
threadThickness = 5;
}
if (threadThickness < 1)
{
threadThickness = 1;
}
txtThreadThickness.Text = threadThickness.ToString();
}
else
{
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";
}
}
}
public frmSettingsDialog()
{
InitializeComponent();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnColor_Click(object sender, EventArgs e)
{
colorDialog1.Color = lblColor.BackColor;
if (colorDialog1.ShowDialog() == DialogResult.OK && lblColor.BackColor != colorDialog1.Color)
{
lblColor.BackColor = colorDialog1.Color;
colorChanged = true;
}
}
private void btnResetColor_Click(object sender, EventArgs e)
{
if (lblColor.BackColor != Color.FromKnownColor(KnownColor.Control))
{
lblColor.BackColor = Color.FromKnownColor(KnownColor.Control);
colorChanged = true;
}
}
private void btnOK_Click(object sender, EventArgs e)
{
if (colorChanged)
{
if (lblColor.BackColor != Color.FromKnownColor(KnownColor.Control))
{
settings.setValue("background color", "enabled", "yes");
settings.setValue("background color", "red", lblColor.BackColor.R.ToString());
settings.setValue("background color", "green", lblColor.BackColor.G.ToString());
settings.setValue("background color", "blue", lblColor.BackColor.B.ToString());
}
else
{
settings.setValue("background color", "enabled", "no");
}
}
double threadThickness = 5;
if (Double.TryParse(txtThreadThickness.Text, out threadThickness))
{
if (threadThickness < 1)
{
threadThickness = 1;
}
settings.setValue("thread thickness", threadThickness.ToString());
}
if (chkUglyStitches.Checked)
{
settings.setValue("filter stitches", "true");
}
else
{
settings.setValue("filter stitches", "false");
}
double threshold = 120;
if (Double.TryParse(txtThreshold.Text, out threshold))
{
if (threshold < 10)
{
threshold = 10;
}
settings.setValue("filter stitches threshold", threshold.ToString());
}
}
}
}

Wyświetl plik

@ -1,83 +1,83 @@
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
namespace embroideryReader
{
partial class frmTextbox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(305, 351);
this.textBox1.TabIndex = 0;
//
// frmTextbox
//
this.ClientSize = new System.Drawing.Size(305, 351);
this.Controls.Add(this.textBox1);
this.Name = "frmTextbox";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
}
/*
Embridery Reader - an application to view .pes embroidery designs
Copyright (C) 2008 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.html.
*/
namespace embroideryReader
{
partial class frmTextbox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(305, 351);
this.textBox1.TabIndex = 0;
//
// frmTextbox
//
this.ClientSize = new System.Drawing.Size(305, 351);
this.Controls.Add(this.textBox1);
this.Name = "frmTextbox";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
}
}

Wyświetl plik

@ -1,49 +1,49 @@
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace embroideryReader
{
public partial class frmTextbox : Form
{
public frmTextbox()
{
InitializeComponent();
}
public void showText(string text)
{
textBox1.Text = text;
this.Show();
}
}
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace embroideryReader
{
public partial class frmTextbox : Form
{
public frmTextbox()
{
InitializeComponent();
}
public void showText(string text)
{
textBox1.Text = text;
this.Show();
}
}
}

Wyświetl plik

@ -1,95 +1,95 @@
namespace embroideryTester
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.btnOpen = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 12);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBox1.Size = new System.Drawing.Size(100, 249);
this.textBox1.TabIndex = 0;
//
// btnOpen
//
this.btnOpen.Location = new System.Drawing.Point(174, 10);
this.btnOpen.Name = "btnOpen";
this.btnOpen.Size = new System.Drawing.Size(75, 23);
this.btnOpen.TabIndex = 1;
this.btnOpen.Text = "Open";
this.btnOpen.UseVisualStyleBackColor = true;
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
//
// btnNext
//
this.btnNext.Enabled = false;
this.btnNext.Location = new System.Drawing.Point(174, 50);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(75, 23);
this.btnNext.TabIndex = 2;
this.btnNext.Text = "Next byte";
this.btnNext.UseVisualStyleBackColor = true;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnOpen);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button btnOpen;
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
}
}
namespace embroideryTester
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.btnOpen = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 12);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBox1.Size = new System.Drawing.Size(100, 249);
this.textBox1.TabIndex = 0;
//
// btnOpen
//
this.btnOpen.Location = new System.Drawing.Point(174, 10);
this.btnOpen.Name = "btnOpen";
this.btnOpen.Size = new System.Drawing.Size(75, 23);
this.btnOpen.TabIndex = 1;
this.btnOpen.Text = "Open";
this.btnOpen.UseVisualStyleBackColor = true;
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
//
// btnNext
//
this.btnNext.Enabled = false;
this.btnNext.Location = new System.Drawing.Point(174, 50);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(75, 23);
this.btnNext.TabIndex = 2;
this.btnNext.Text = "Next byte";
this.btnNext.UseVisualStyleBackColor = true;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnOpen);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button btnOpen;
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
}
}

Wyświetl plik

@ -1,121 +1,121 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
namespace embroideryTester
{
public partial class Form1 : Form
{
//BinaryReader file;
//byte[] shorts;
//int byteNume = 0;
//short itemNumber = 0;
public Form1()
{
InitializeComponent();
}
private void btnOpen_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
//byte[] bytes;
//bytes = File.ReadAllBytes(openFileDialog1.FileName);
//shorts = File.ReadAllBytes(openFileDialog1.FileName);
//GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
//IntPtr ptr = handle.AddrOfPinnedObject();
////ReDim bytes((bytes.Length \ 2) - 1)
////int temp = bytes.Length;
////temp = temp /2
//shorts = new short[bytes.Length / 2 - 1];
//Marshal.Copy(ptr, shorts, 0, shorts.Length);
//handle.Free();
//this.Text = openFileDialog1.FileName;
//btnNext.Enabled = true;
System.IO.BinaryReader fileIn = new System.IO.BinaryReader(System.IO.File.Open(openFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read));
long restorePos = fileIn.BaseStream.Position;
byte[] tempbytes = fileIn.ReadBytes(10240);
string tempstring = "";
for (int ctr = 0; ctr < tempbytes.Length; ctr++)
{
tempstring += (char)tempbytes[ctr];
}
if (tempstring.Contains("CEmbOne"))
{
fileIn.BaseStream.Position = restorePos + tempstring.IndexOf("CEmbOne") + 7;
}
else if (tempstring.Contains("CEmbPunch"))
{
fileIn.BaseStream.Position = restorePos + tempstring.IndexOf("CEmbPunch") + 9;
}
string temp = "";
textBox1.Visible = false;
while(fileIn.BaseStream.Position +1< fileIn.BaseStream.Length)
{
temp += fileIn.ReadInt16().ToString() + Environment.NewLine;
}
textBox1.Text = temp;
textBox1.Visible = true;
}
}
private void btnNext_Click(object sender, EventArgs e)
{
////textBox1.Text += file.BaseStream.Position.ToString() +" 0x"+ file.ReadByte().ToString("X")+Environment.NewLine;
//string temp = "";
//textBox1.Visible = false;
//for (int i = 0; i < shorts.Length; i++)
//{
// temp += shorts[i].ToString("X") + Environment.NewLine;
//}
//textBox1.Text = temp;
//textBox1.Visible = true;
//textBox1.Select(textBox1.Text.Length, 0);
//textBox1.ScrollToCaret();
////itemNumber++;
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.MaxLength = Int32.MaxValue;
this.BackColor = GetRGB(2037741);
}
private Color getColorFromIndex(int index)
{
Color retval = Color.Black;
switch (index)
{
case 1:
retval = Color.FromArgb(8134414);
break;
case 2:
retval = Color.FromArgb(11561576);
break;
}
return retval;
}
private Color GetRGB(long RGB)
{
long Red, Green, Blue;
Red = RGB & 255;
Green = RGB % 256 & 255;
Blue = RGB % 256 ^ 2 & 255;
Console.WriteLine("RGB: " + Blue.ToString() + ", " + Green.ToString() + ", " + Red.ToString());
return Color.FromArgb((int)Blue, (int)Green, (int)Red);
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
namespace embroideryTester
{
public partial class Form1 : Form
{
//BinaryReader file;
//byte[] shorts;
//int byteNume = 0;
//short itemNumber = 0;
public Form1()
{
InitializeComponent();
}
private void btnOpen_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
//byte[] bytes;
//bytes = File.ReadAllBytes(openFileDialog1.FileName);
//shorts = File.ReadAllBytes(openFileDialog1.FileName);
//GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
//IntPtr ptr = handle.AddrOfPinnedObject();
////ReDim bytes((bytes.Length \ 2) - 1)
////int temp = bytes.Length;
////temp = temp /2
//shorts = new short[bytes.Length / 2 - 1];
//Marshal.Copy(ptr, shorts, 0, shorts.Length);
//handle.Free();
//this.Text = openFileDialog1.FileName;
//btnNext.Enabled = true;
System.IO.BinaryReader fileIn = new System.IO.BinaryReader(System.IO.File.Open(openFileDialog1.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read));
long restorePos = fileIn.BaseStream.Position;
byte[] tempbytes = fileIn.ReadBytes(10240);
string tempstring = "";
for (int ctr = 0; ctr < tempbytes.Length; ctr++)
{
tempstring += (char)tempbytes[ctr];
}
if (tempstring.Contains("CEmbOne"))
{
fileIn.BaseStream.Position = restorePos + tempstring.IndexOf("CEmbOne") + 7;
}
else if (tempstring.Contains("CEmbPunch"))
{
fileIn.BaseStream.Position = restorePos + tempstring.IndexOf("CEmbPunch") + 9;
}
string temp = "";
textBox1.Visible = false;
while(fileIn.BaseStream.Position +1< fileIn.BaseStream.Length)
{
temp += fileIn.ReadInt16().ToString() + Environment.NewLine;
}
textBox1.Text = temp;
textBox1.Visible = true;
}
}
private void btnNext_Click(object sender, EventArgs e)
{
////textBox1.Text += file.BaseStream.Position.ToString() +" 0x"+ file.ReadByte().ToString("X")+Environment.NewLine;
//string temp = "";
//textBox1.Visible = false;
//for (int i = 0; i < shorts.Length; i++)
//{
// temp += shorts[i].ToString("X") + Environment.NewLine;
//}
//textBox1.Text = temp;
//textBox1.Visible = true;
//textBox1.Select(textBox1.Text.Length, 0);
//textBox1.ScrollToCaret();
////itemNumber++;
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.MaxLength = Int32.MaxValue;
this.BackColor = GetRGB(2037741);
}
private Color getColorFromIndex(int index)
{
Color retval = Color.Black;
switch (index)
{
case 1:
retval = Color.FromArgb(8134414);
break;
case 2:
retval = Color.FromArgb(11561576);
break;
}
return retval;
}
private Color GetRGB(long RGB)
{
long Red, Green, Blue;
Red = RGB & 255;
Green = RGB % 256 & 255;
Blue = RGB % 256 ^ 2 & 255;
Console.WriteLine("RGB: " + Blue.ToString() + ", " + Green.ToString() + ", " + Red.ToString());
return Color.FromArgb((int)Blue, (int)Green, (int)Red);
}
}
}

Wyświetl plik

@ -1,44 +1,44 @@
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace embroideryTester
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
/*
Embroidery Reader - an application to view .pes embroidery designs
Copyright (C) 2009 Nathan Crawford
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
A copy of the full GPL 2 license can be found in the docs directory.
You can contact me at http://www.njcrawford.com/contact.php.
*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace embroideryTester
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

Wyświetl plik

@ -1,33 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("emroideryTester")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("emroideryTester")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4a7aaea6-31e9-473d-b174-ce5787227af5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("emroideryTester")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("emroideryTester")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4a7aaea6-31e9-473d-b174-ce5787227af5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Wyświetl plik

@ -1,63 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryTester.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("embroideryTester.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryTester.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("embroideryTester.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

Wyświetl plik

@ -1,26 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryTester.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace embroideryTester.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

Wyświetl plik

@ -1,167 +1,167 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace embroideryThumbs
{
//[Guid("69EA0D51-1BD4-4c6e-9AE0-B13C915A59E3")]
//public interface EmbThumbnailInterface
//{
// //COM visible function go here
//}
[StructLayout(LayoutKind.Sequential)]
public struct SIZE
{
public int cx;
public int cy;
public SIZE(int cx, int cy)
{
this.cx = cx;
this.cy = cy;
}
}
[ComImport, Guid("0000010c-0000-0000-c000-000000000046"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPersist
{
[PreserveSig]
void GetClassID(out Guid pClassID);
}
[ComImport, Guid("0000010b-0000-0000-C000-000000000046"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPersistFile : IPersist
{
//new void GetClassID(out Guid pClassID);
[PreserveSig]
int IsDirty();
[PreserveSig]
void Load([In, MarshalAs(UnmanagedType.LPWStr)]
string pszFileName, uint dwMode);
[PreserveSig]
void Save([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName,
[In, MarshalAs(UnmanagedType.Bool)] bool fRemember);
[PreserveSig]
void SaveCompleted([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName);
[PreserveSig]
void GetCurFile([In, MarshalAs(UnmanagedType.LPWStr)] string ppszFileName);
}
[ComImportAttribute()]
[GuidAttribute("BB2E617C-0920-11d1-9A0B-00C04FC2D6C1")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
interface IExtractImage
{
void GetLocation(
[Out, MarshalAs(UnmanagedType.LPWStr)]
StringBuilder pszPathBuffer,
int cch,
ref int pdwPriority,
ref SIZE prgSize,
int dwRecClrDepth,
ref int pdwFlags);
void Extract(out IntPtr phBmpThumbnail);
}
//[Guid("xxxx"),
//InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
//public interface IExtractImage2
//{
// // from IExtractImage
// void Extract();
// void GetLocation();
// HRESULT GetDateStamp([Out] System.Runtime.InteropServices.ComTypes.FILETIME* pDateStamp);
//}
[Guid("EA7D5329-E9D7-49fb-9F55-A12D1A2ADB5D"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface EmbThumbnailEvents
{
}
[Guid("7E3EF3E8-39D4-4150-9EFF-58C71A1F4F9E"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(EmbThumbnailEvents))]
public class EmbThumbnail : IPersistFile, IExtractImage
{
PesFile.PesFile designFile;
public void GetClassID(out Guid pClassID)
{
// not implemented, but won't compile without this
pClassID = new Guid("7E3EF3E8-39D4-4150-9EFF-58C71A1F4F9E");
}
public int IsDirty()
{
return 0;
}
public void Load([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName, uint dwMode)
{
if(pszFileName.Substring(pszFileName.Length - 4).ToLower() == ".pes")
{
designFile = new PesFile.PesFile(pszFileName);
}
}
public void Save([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName, [In, MarshalAs(UnmanagedType.Bool)] bool fRemember)
{
//not implemented
}
public void SaveCompleted([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName)
{
//not implemented
}
public void GetCurFile([In, MarshalAs(UnmanagedType.LPWStr)] string ppszFileName)
{
//not implemented
}
public void GetLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPathBuffer, int cch, ref int pdwPriority, ref SIZE prgSize, int dwRecClrDepth, ref int pdwFlags)
{
//not implemented
}
public unsafe void Extract(out IntPtr phBmpThumbnail)
{
System.Drawing.Bitmap designBitmap = designFile.designToBitmap(3, false, 0);
IntPtr hBmp = designBitmap.GetHbitmap();
phBmpThumbnail = new IntPtr();
// Assuming you already have hBmp as the handle to your Bitmap object...
if (IntPtr.Size == 4)
{
int* pBuffer = (int*)phBmpThumbnail.ToPointer();
*pBuffer = hBmp.ToInt32();
// IMO, casting back to (void*) is not necessary.
// I guess just for formality, that pBuffer points
// to an object, not an int. :)
phBmpThumbnail = new IntPtr((void*)pBuffer);
}
else // 8-bytes, or 64-bit
{
long* pBuffer = (long*)phBmpThumbnail.ToPointer();
*pBuffer = hBmp.ToInt64();
phBmpThumbnail = new IntPtr((void*)pBuffer);
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace embroideryThumbs
{
//[Guid("69EA0D51-1BD4-4c6e-9AE0-B13C915A59E3")]
//public interface EmbThumbnailInterface
//{
// //COM visible function go here
//}
[StructLayout(LayoutKind.Sequential)]
public struct SIZE
{
public int cx;
public int cy;
public SIZE(int cx, int cy)
{
this.cx = cx;
this.cy = cy;
}
}
[ComImport, Guid("0000010c-0000-0000-c000-000000000046"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPersist
{
[PreserveSig]
void GetClassID(out Guid pClassID);
}
[ComImport, Guid("0000010b-0000-0000-C000-000000000046"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPersistFile : IPersist
{
//new void GetClassID(out Guid pClassID);
[PreserveSig]
int IsDirty();
[PreserveSig]
void Load([In, MarshalAs(UnmanagedType.LPWStr)]
string pszFileName, uint dwMode);
[PreserveSig]
void Save([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName,
[In, MarshalAs(UnmanagedType.Bool)] bool fRemember);
[PreserveSig]
void SaveCompleted([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName);
[PreserveSig]
void GetCurFile([In, MarshalAs(UnmanagedType.LPWStr)] string ppszFileName);
}
[ComImportAttribute()]
[GuidAttribute("BB2E617C-0920-11d1-9A0B-00C04FC2D6C1")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
interface IExtractImage
{
void GetLocation(
[Out, MarshalAs(UnmanagedType.LPWStr)]
StringBuilder pszPathBuffer,
int cch,
ref int pdwPriority,
ref SIZE prgSize,
int dwRecClrDepth,
ref int pdwFlags);
void Extract(out IntPtr phBmpThumbnail);
}
//[Guid("xxxx"),
//InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
//public interface IExtractImage2
//{
// // from IExtractImage
// void Extract();
// void GetLocation();
// HRESULT GetDateStamp([Out] System.Runtime.InteropServices.ComTypes.FILETIME* pDateStamp);
//}
[Guid("EA7D5329-E9D7-49fb-9F55-A12D1A2ADB5D"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface EmbThumbnailEvents
{
}
[Guid("7E3EF3E8-39D4-4150-9EFF-58C71A1F4F9E"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(EmbThumbnailEvents))]
public class EmbThumbnail : IPersistFile, IExtractImage
{
PesFile.PesFile designFile;
public void GetClassID(out Guid pClassID)
{
// not implemented, but won't compile without this
pClassID = new Guid("7E3EF3E8-39D4-4150-9EFF-58C71A1F4F9E");
}
public int IsDirty()
{
return 0;
}
public void Load([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName, uint dwMode)
{
if(pszFileName.Substring(pszFileName.Length - 4).ToLower() == ".pes")
{
designFile = new PesFile.PesFile(pszFileName);
}
}
public void Save([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName, [In, MarshalAs(UnmanagedType.Bool)] bool fRemember)
{
//not implemented
}
public void SaveCompleted([In, MarshalAs(UnmanagedType.LPWStr)] string pszFileName)
{
//not implemented
}
public void GetCurFile([In, MarshalAs(UnmanagedType.LPWStr)] string ppszFileName)
{
//not implemented
}
public void GetLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPathBuffer, int cch, ref int pdwPriority, ref SIZE prgSize, int dwRecClrDepth, ref int pdwFlags)
{
//not implemented
}
public unsafe void Extract(out IntPtr phBmpThumbnail)
{
System.Drawing.Bitmap designBitmap = designFile.designToBitmap(3, false, 0);
IntPtr hBmp = designBitmap.GetHbitmap();
phBmpThumbnail = new IntPtr();
// Assuming you already have hBmp as the handle to your Bitmap object...
if (IntPtr.Size == 4)
{
int* pBuffer = (int*)phBmpThumbnail.ToPointer();
*pBuffer = hBmp.ToInt32();
// IMO, casting back to (void*) is not necessary.
// I guess just for formality, that pBuffer points
// to an object, not an int. :)
phBmpThumbnail = new IntPtr((void*)pBuffer);
}
else // 8-bytes, or 64-bit
{
long* pBuffer = (long*)phBmpThumbnail.ToPointer();
*pBuffer = hBmp.ToInt64();
phBmpThumbnail = new IntPtr((void*)pBuffer);
}
}
}
}