From a6e05858ea27231da1720aaf79c9c836f2bad513 Mon Sep 17 00:00:00 2001 From: Ben Owen Date: Thu, 17 Jan 2019 20:41:15 +0000 Subject: [PATCH] Update Sample 05 (Working with pixels) to .NET Core 2.1 / 4.7.2 (issue #8) --- .../Program.cs | 17 ++- .../Properties/AssemblyInfo.cs | 16 --- ...ample 05 - Working with pixels.2005.csproj | 100 --------------- .../Sample 05 - Working with pixels.csproj | 114 ++++-------------- .../Sample 05 - Working with pixels.sln | 31 +++++ 5 files changed, 59 insertions(+), 219 deletions(-) delete mode 100644 src/Samples/Sample 05 - Working with pixels/Properties/AssemblyInfo.cs delete mode 100644 src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.2005.csproj create mode 100644 src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.sln diff --git a/src/Samples/Sample 05 - Working with pixels/Program.cs b/src/Samples/Sample 05 - Working with pixels/Program.cs index 40f878f..dcb61da 100644 --- a/src/Samples/Sample 05 - Working with pixels/Program.cs +++ b/src/Samples/Sample 05 - Working with pixels/Program.cs @@ -1,21 +1,18 @@ using System; using FreeImageAPI; -using System.Drawing; +using FreeImageNETUnitTest; namespace Sample05 { - class Program + class Program { static void Main(string[] args) { - // Check if FreeImage.dll is available (can be in %path%). - if (!FreeImage.IsAvailable()) - { - Console.WriteLine("FreeImage.dll seems to be missing. Aborting."); - return; - } - Sample sample = new Sample(); + NativeLibraryLoader.CopyFreeImageNativeDll(); + FreeImage.ValidateAvailability(); + + Sample sample = new Sample(); // The example will flip the bitmap by manually accessing the // bitmaps scanlines and swapping them @@ -210,4 +207,4 @@ public void Example03() } } } -} \ No newline at end of file +} diff --git a/src/Samples/Sample 05 - Working with pixels/Properties/AssemblyInfo.cs b/src/Samples/Sample 05 - Working with pixels/Properties/AssemblyInfo.cs deleted file mode 100644 index 35304a0..0000000 --- a/src/Samples/Sample 05 - Working with pixels/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: Guid("fd43331d-5ea4-40f8-86d5-8f820d606912")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.2005.csproj b/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.2005.csproj deleted file mode 100644 index 713a2ac..0000000 --- a/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.2005.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {A501F134-8FB6-460B-AFE9-884A696C1C07} - Exe - Properties - Sample05 - Sample05 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - none - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\Debug\ - DEBUG;TRACE - full - x86 - false - prompt - - - bin\Release\ - TRACE - true - - - x86 - false - prompt - - - true - bin\Debug\ - DEBUG;TRACE - full - x64 - false - prompt - - - bin\Release\ - TRACE - true - - - x64 - false - prompt - - - - - - - - - - - - Always - - - Always - - - - - {6598A7CD-8F27-4D3F-A675-5AE63113A7C3} - Library - - - - - \ No newline at end of file diff --git a/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.csproj b/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.csproj index 3cb5368..c154cf2 100644 --- a/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.csproj +++ b/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.csproj @@ -1,105 +1,33 @@ - + + - Debug - AnyCPU - 8.0.50727 - 2.0 - {A501F134-8FB6-460B-AFE9-884A696C1C07} + Sample03 + netcoreapp2.1;net472 + Exe - Properties - Sample05 - Sample05 - - - 2.0 - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - none - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\Debug\ - DEBUG;TRACE - full - x86 - false - prompt - - - bin\Release\ - TRACE - true - - - x86 - false - prompt - - - true - bin\Debug\ - DEBUG;TRACE - full - x64 - false - prompt - - - bin\Release\ - TRACE - true - - - x64 - false - prompt + + Sample03 + Sample03 + - - + + - - + + - - Always - - - Always - + + - - {6598A7CD-8F27-4D3F-A675-5AE63113A7C3} - Library - + + PreserveNewest + + + PreserveNewest + - - \ No newline at end of file diff --git a/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.sln b/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.sln new file mode 100644 index 0000000..13504d0 --- /dev/null +++ b/src/Samples/Sample 05 - Working with pixels/Sample 05 - Working with pixels.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample 05 - Working with pixels", "Sample 05 - Working with pixels.csproj", "{1CC93412-5D72-4BF4-8AF0-1D6BF97202B5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeImage.Standard", "..\..\FreeImage.Standard\FreeImage.Standard.csproj", "{687D1D9A-B67F-4898-AE57-943FFFEC761F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1CC93412-5D72-4BF4-8AF0-1D6BF97202B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1CC93412-5D72-4BF4-8AF0-1D6BF97202B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CC93412-5D72-4BF4-8AF0-1D6BF97202B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1CC93412-5D72-4BF4-8AF0-1D6BF97202B5}.Release|Any CPU.Build.0 = Release|Any CPU + {687D1D9A-B67F-4898-AE57-943FFFEC761F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {687D1D9A-B67F-4898-AE57-943FFFEC761F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {687D1D9A-B67F-4898-AE57-943FFFEC761F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {687D1D9A-B67F-4898-AE57-943FFFEC761F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {487866D4-8B62-4123-BCAC-153B40CAAD1D} + EndGlobalSection +EndGlobal