-
Notifications
You must be signed in to change notification settings - Fork 30
964307-Add UG for converting Excel document to Image in Windows Forms #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d443c3f
964307-ExcelToImageWinFormsExample
KarthikaSF4773 7c99d2c
964307-ExcelToImageWinFormsExample
KarthikaSF4773 7e92a7c
964307-ExcelToImageWinFormsExample
KarthikaSF4773 721ad15
964307-ExcelToImageWinFormsExample
KarthikaSF4773 28e9e1b
964307-ExcelToImageWinFormsExample
KarthikaSF4773 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
...Windows Forms/Convert Excel to Image/Convert Excel to Image/Convert Excel to Image.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
| <PropertyGroup> | ||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
| <ProjectGuid>{DDE2395A-AE2F-4C3B-B427-E3045FE2E702}</ProjectGuid> | ||
| <OutputType>WinExe</OutputType> | ||
| <RootNamespace>Convert_Excel_to_Image</RootNamespace> | ||
| <AssemblyName>Convert Excel to Image</AssemblyName> | ||
| <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> | ||
| <FileAlignment>512</FileAlignment> | ||
| <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
| <Deterministic>true</Deterministic> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
| <PlatformTarget>AnyCPU</PlatformTarget> | ||
| <DebugSymbols>true</DebugSymbols> | ||
| <DebugType>full</DebugType> | ||
| <Optimize>false</Optimize> | ||
| <OutputPath>bin\Debug\</OutputPath> | ||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
| <PlatformTarget>AnyCPU</PlatformTarget> | ||
| <DebugType>pdbonly</DebugType> | ||
| <Optimize>true</Optimize> | ||
| <OutputPath>bin\Release\</OutputPath> | ||
| <DefineConstants>TRACE</DefineConstants> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <Reference Include="System" /> | ||
| <Reference Include="System.Core" /> | ||
| <Reference Include="System.Xml.Linq" /> | ||
| <Reference Include="System.Data.DataSetExtensions" /> | ||
| <Reference Include="Microsoft.CSharp" /> | ||
| <Reference Include="System.Data" /> | ||
| <Reference Include="System.Deployment" /> | ||
| <Reference Include="System.Drawing" /> | ||
| <Reference Include="System.Net.Http" /> | ||
| <Reference Include="System.Windows.Forms" /> | ||
| <Reference Include="System.Xml" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Compile Include="Form1.cs"> | ||
| <SubType>Form</SubType> | ||
| </Compile> | ||
| <Compile Include="Form1.Designer.cs"> | ||
| <DependentUpon>Form1.cs</DependentUpon> | ||
| </Compile> | ||
| <Compile Include="Program.cs" /> | ||
| <Compile Include="Properties\AssemblyInfo.cs" /> | ||
| <EmbeddedResource Include="Properties\Resources.resx"> | ||
| <Generator>ResXFileCodeGenerator</Generator> | ||
| <LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
| <SubType>Designer</SubType> | ||
| </EmbeddedResource> | ||
| <Compile Include="Properties\Resources.Designer.cs"> | ||
| <AutoGen>True</AutoGen> | ||
| <DependentUpon>Resources.resx</DependentUpon> | ||
| </Compile> | ||
| <None Include="packages.config" /> | ||
| <None Include="Properties\Settings.settings"> | ||
| <Generator>SettingsSingleFileGenerator</Generator> | ||
| <LastGenOutput>Settings.Designer.cs</LastGenOutput> | ||
| </None> | ||
| <Compile Include="Properties\Settings.Designer.cs"> | ||
| <AutoGen>True</AutoGen> | ||
| <DependentUpon>Settings.settings</DependentUpon> | ||
| <DesignTimeSharedInput>True</DesignTimeSharedInput> | ||
| </Compile> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="App.config" /> | ||
| </ItemGroup> | ||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
| </Project> | ||
Binary file added
BIN
+10.9 KB
Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Data/Sample.xlsx
Binary file not shown.
75 changes: 75 additions & 0 deletions
75
...ing Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Form1.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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(); | ||
| } | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
Getting Started/Windows Forms/Convert Excel to Image/Convert Excel to Image/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| { | ||
| /// <summary> | ||
| /// The main entry point for the application. | ||
| /// </summary> | ||
| [STAThread] | ||
| static void Main() | ||
| { | ||
| Application.EnableVisualStyles(); | ||
| Application.SetCompatibleTextRenderingDefault(false); | ||
| Application.Run(new Form1()); | ||
| } | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
...ed/Windows Forms/Convert Excel to Image/Convert Excel to Image/Properties/AssemblyInfo.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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")] |
71 changes: 71 additions & 0 deletions
71
...dows Forms/Convert Excel to Image/Convert Excel to Image/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this reference