csharp-message-to-image-library is a test/sample C# solution with an ordinary (non-MFC) C++ DLL project.
The purpose of this solution is to work out how to create a C++ DLL and utilise it in C#.
This repository is an off-shoot of csharp-stream-controller
This project is a non-MFC C++ DLL project.
It exports a limited number of functions that are abstractions of some Direct2D and DirectWrite functions.
This is the main C# WPF .NET Core 3.1 project.
It is (now) a C# wrapper around Direct2DWrapper providing a limited set of features so that a message (such as a Tweet) can be transformed into a PNG file.
In order to use the library, the Direct2DWrapper project will need building to generate Direct2DWrapper.dll and a link file created in MessageToImageLibrary\lib pointing at the Direct2DWrapper.dll file.
The C# project needs to be able to find Direct2DWrapper.dll.
MessageToImageLibrary exports a generic Add(int a, double b)
function found in Direct2DWrapper.
If the projects are built correctly, the Visual Studio debug Output window should include the following output on instantiation of a C# MessageToImageLibrary.Direct2DWrapper
instance:
Result of external Add(10, 3) = 13.
class Test()
{
private readonly MessageToImageLibrary.Direct2DWrapper d2dWrapper;
Test()
{
Trace.WriteLine("Testing DLL...");
d2dWrapper = new MessageToImageLibrary.Direct2DWrapper();
}
}
The expected output listed above may be out of date as documentation changes typically lag code changes. Check recent commits for changes.