diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/App.config b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/App.config new file mode 100644 index 00000000..94e88573 --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Convert Excel to Image.csproj b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Convert Excel to Image.csproj new file mode 100644 index 00000000..ef969da3 --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Convert Excel to Image.csproj @@ -0,0 +1,90 @@ + + + + + Debug + AnyCPU + {DDE2395A-AE2F-4C3B-B427-E3045FE2E702} + WinExe + Convert_Excel_to_Image + Convert Excel to Image + v4.8 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Syncfusion.Compression.Base.100.2.38\lib\net462\Syncfusion.Compression.Base.dll + + + ..\packages\Syncfusion.Licensing.29.2.11\lib\net462\Syncfusion.Licensing.dll + + + ..\packages\Syncfusion.XlsIO.WinForms.29.2.11\lib\net462\Syncfusion.XlsIO.Base.dll + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Data/Sample.xlsx b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Data/Sample.xlsx new file mode 100644 index 00000000..a7c5e8d7 Binary files /dev/null and b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Data/Sample.xlsx differ diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.Designer.cs b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.Designer.cs new file mode 100644 index 00000000..0aa5643f --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.Designer.cs @@ -0,0 +1,75 @@ +using Syncfusion.XlsIO; +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace Convert_Excel_to_Image +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + + private Button btnCreate; + private Label label; + + private void InitializeComponent() + { + this.label = new System.Windows.Forms.Label(); + this.btnCreate = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label + // + this.label.Location = new System.Drawing.Point(0, 40); + this.label.Name = "label"; + this.label.Size = new System.Drawing.Size(426, 35); + this.label.TabIndex = 0; + this.label.Text = "Click the button to Convert Excel document to Image generated by Essential XlsIO"; + this.label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // btnCreate + // + this.btnCreate.Location = new System.Drawing.Point(90, 110); + this.btnCreate.Name = "btnCreate"; + this.btnCreate.Size = new System.Drawing.Size(223, 36); + this.btnCreate.TabIndex = 1; + this.btnCreate.Text = "Convert Excel to Image"; + this.btnCreate.Click += new System.EventHandler(this.btnConvert_Click); + // + // Form1 + // + this.ClientSize = new System.Drawing.Size(450, 150); + this.Controls.Add(this.label); + this.Controls.Add(this.btnCreate); + this.Name = "Form1"; + this.Text = "Convert Excel document to Image"; + this.ResumeLayout(false); + } + + #endregion + } +} + diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.cs b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.cs new file mode 100644 index 00000000..f927042e --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.cs @@ -0,0 +1,46 @@ +using Syncfusion.XlsIO; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Convert_Excel_to_Image +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void btnConvert_Click(object sender, EventArgs e) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + FileStream excelStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(excelStream); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Convert the Excel to Image + Image image = worksheet.ConvertToImage(1, 1, 20, 4); + + //Save the image as jpeg + image.Save("Sample.Jpeg", ImageFormat.Jpeg); + } + + //Launch the Image file + System.Diagnostics.Process process = new System.Diagnostics.Process(); + process.StartInfo = new System.Diagnostics.ProcessStartInfo(Path.GetFullPath(@"../../Sample.Jpeg")) { UseShellExecute = true }; + process.Start(); + } + } +} diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Program.cs b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Program.cs new file mode 100644 index 00000000..49a0ce6b --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Convert_Excel_to_Image +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/AssemblyInfo.cs b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c5a38d8b --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/AssemblyInfo.cs @@ -0,0 +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("Convert Excel to Image")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Convert Excel to Image")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[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("dde2395a-ae2f-4c3b-b427-e3045fe2e702")] + +// 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")] diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Resources.Designer.cs b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Resources.Designer.cs new file mode 100644 index 00000000..4f7d9eeb --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Convert_Excel_to_Image.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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", "4.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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [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("Convert_Excel_to_Image.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Resources.resx b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Settings.Designer.cs b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Settings.Designer.cs new file mode 100644 index 00000000..d3f3b579 --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Convert_Excel_to_Image.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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; + } + } + } +} diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Settings.settings b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/packages.config b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/packages.config new file mode 100644 index 00000000..b91de7c0 --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Getting Started/Windows Forms/Convert Excel to Image/ConvertExcelToImage.sln b/Getting Started/Windows Forms/Convert Excel to Image/ConvertExcelToImage.sln new file mode 100644 index 00000000..229daf4f --- /dev/null +++ b/Getting Started/Windows Forms/Convert Excel to Image/ConvertExcelToImage.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36127.28 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert Excel to Image", "Convert Excel to Image\Convert Excel to Image.csproj", "{DDE2395A-AE2F-4C3B-B427-E3045FE2E702}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DDE2395A-AE2F-4C3B-B427-E3045FE2E702}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DDE2395A-AE2F-4C3B-B427-E3045FE2E702}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DDE2395A-AE2F-4C3B-B427-E3045FE2E702}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DDE2395A-AE2F-4C3B-B427-E3045FE2E702}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {06F160E4-D05B-43F5-845F-41497BCBF8F2} + EndGlobalSection +EndGlobal