Skip to content

Commit

Permalink
Update Sample 03 (Allocating) to .NET Core 2.1 / 4.7.2.
Browse files Browse the repository at this point in the history
(issue #8)
  • Loading branch information
LordBenjamin committed Jan 17, 2019
1 parent fbb565c commit 9953fe5
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 200 deletions.
17 changes: 9 additions & 8 deletions src/Samples/Sample 03 - Allocating/Program.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
using System;
using System.IO;
using FreeImageAPI;
using FreeImageNETUnitTest;

namespace Sample03
{
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;
}
NativeLibraryLoader.CopyFreeImageNativeDll();

// Add this class to the message event
FreeImageEngine.Message += new OutputMessageFunction(FreeImage_Message);
// Check if FreeImage.dll is available (can be in %path%).
FreeImage.ValidateAvailability();

// Add this class to the message event
FreeImageEngine.Message += new OutputMessageFunction(FreeImage_Message);

Sample sample = new Sample();
sample.Example();

// Remove this class from the message event
FreeImageEngine.Message -= new OutputMessageFunction(FreeImage_Message);

Console.ReadKey();
}

static void FreeImage_Message(FREE_IMAGE_FORMAT fif, string message)
Expand Down
16 changes: 0 additions & 16 deletions src/Samples/Sample 03 - Allocating/Properties/AssemblyInfo.cs

This file was deleted.

This file was deleted.

98 changes: 13 additions & 85 deletions src/Samples/Sample 03 - Allocating/Sample 03 - Allocating.csproj
Original file line number Diff line number Diff line change
@@ -1,96 +1,24 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A7E452A1-1A43-47C4-8BF3-DA28E1402FB9}</ProjectGuid>
<AssemblyTitle>Sample03</AssemblyTitle>
<TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
<ApplicationIcon />
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sample03</RootNamespace>
<StartupObject />
<AssemblyName>Sample03</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>
</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>
</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<RootNamespace>Sample03</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Compile Include="..\..\UnitTest\NativeLibraryLoader.cs" Link="NativeLibraryLoader.cs" />
</ItemGroup>

<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<ProjectReference Include="..\..\FreeImage.Standard\FreeImage.Standard.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Library\Library.csproj">
<Project>{6598A7CD-8F27-4D3F-A675-5AE63113A7C3}</Project>
<Name>Library</Name>
</ProjectReference>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
31 changes: 31 additions & 0 deletions src/Samples/Sample 03 - Allocating/Sample 03 - Allocating.sln
Original file line number Diff line number Diff line change
@@ -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 03 - Allocating", "Sample 03 - Allocating.csproj", "{D039F3CE-4C79-43AF-BED5-9A69D561FE25}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeImage.Standard", "..\..\FreeImage.Standard\FreeImage.Standard.csproj", "{0A36569A-A782-42A4-BD89-3D647066ED1F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D039F3CE-4C79-43AF-BED5-9A69D561FE25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D039F3CE-4C79-43AF-BED5-9A69D561FE25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D039F3CE-4C79-43AF-BED5-9A69D561FE25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D039F3CE-4C79-43AF-BED5-9A69D561FE25}.Release|Any CPU.Build.0 = Release|Any CPU
{0A36569A-A782-42A4-BD89-3D647066ED1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A36569A-A782-42A4-BD89-3D647066ED1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A36569A-A782-42A4-BD89-3D647066ED1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A36569A-A782-42A4-BD89-3D647066ED1F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {15505875-A851-40BB-9D41-35E5B9667999}
EndGlobalSection
EndGlobal

0 comments on commit 9953fe5

Please sign in to comment.