-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30804.86 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pixcel", "Pixcel\Pixcel.csproj", "{5C53F119-B7F4-4224-A90F-225D66BC5D12}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{5C53F119-B7F4-4224-A90F-225D66BC5D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{5C53F119-B7F4-4224-A90F-225D66BC5D12}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{5C53F119-B7F4-4224-A90F-225D66BC5D12}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{5C53F119-B7F4-4224-A90F-225D66BC5D12}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {6E63A6E5-8FB0-4A9E-9975-D0F472EB1257} | ||
EndGlobalSection | ||
EndGlobal |
This file contains 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,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<Authors>Michaël Hompus</Authors> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="EPPlus" Version="5.5.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains 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,28 @@ | ||
using OfficeOpenXml; | ||
using OfficeOpenXml.Style; | ||
using System.Drawing; | ||
using System.IO; | ||
|
||
var source = args[0]; | ||
|
||
var bitmap = new Bitmap(64, 64); | ||
using var graphics = Graphics.FromImage(bitmap); | ||
graphics.DrawImage(new Bitmap(source), 0, 0, 64, 64); | ||
|
||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial; | ||
using var package = new ExcelPackage(new FileInfo(source.Replace(Path.GetExtension(source), ".xlsx"))); | ||
var worksheet = package.Workbook.Worksheets["Pixcel"] ?? package.Workbook.Worksheets.Add("Pixcel"); | ||
|
||
for (int y = 1; y <= bitmap.Width; y++) | ||
{ | ||
worksheet.Column(y).Width = 5; | ||
|
||
for (int x = 1; x <= bitmap.Height; x++) | ||
{ | ||
worksheet.Row(x).Height = 25; | ||
worksheet.Cells[x, y].Style.Fill.PatternType = ExcelFillStyle.Solid; | ||
worksheet.Cells[x, y].Style.Fill.BackgroundColor.SetColor(bitmap.GetPixel(y - 1, x - 1)); | ||
} | ||
} | ||
|
||
package.Save(); |
This file contains 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,8 @@ | ||
{ | ||
"profiles": { | ||
"Pixcel": { | ||
"commandName": "Project", | ||
"commandLineArgs": "\"C:\\Users\\micha\\Pictures\\Info Support\\Profile1000x1000.jpg\"" | ||
} | ||
} | ||
} |