# WordCloudCsharp **Repository Path**: mantinal/WordCloudCsharp ## Basic Information - **Project Name**: WordCloudCsharp - **Description**: c#词云 ☁️ Ported from http://wordcloud.codeplex.com/ - **Primary Language**: C# - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-28 - **Last Updated**: 2022-07-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Notice This project comes from another author.Wait to merge into the main line * [WordCloudSharp](https://github.com/AmmRage/WordCloudSharp) * ? Suspected fix GC problem, waiting for test # Ported Repository Info This project is ported from a Codeplex hosted repository. * [orig repo](http://wordcloud.codeplex.com/) * [orig author](http://www.codeplex.com/site/users/view/briancullen) # Install [![NuGet](https://img.shields.io/nuget/v/WordCloudCsharp.svg)](https://www.nuget.org/packages/WordCloudCsharp) # Usage * NameSpace ?命名空间 ``` using WordCloudCsharp; ``` * Singletion ?自带单例 ``` using var images = ISingletion.Instance .GetWordCloud(4000, 4000) .Draw(new List() { "Sign", "Xia" }, new List() { 1, 2 }); images.Save($"D:\\{Guid.NewGuid()}.png", ImageFormat.Png); ``` * IOC ?IOC使用 ``` //di ?注入 services.AddSingleton(); //ctor ?构造函数注入 readonly IWordcloud _wordcloud; public XXX(IWordcloud wordcloud) { _wordcloud = wordcloud; } using var images = _wordcloud.GetWordCloud(4000, 4000) .Draw(new List() { "Sign", "Xia" }, new List() { 1, 2 }); images.Save($"D:\\{Guid.NewGuid()}.png", ImageFormat.Png); ``` for more details, please ref to the usage in UnitTest1. ?更多使用用例请查看 UnitTest1 # Generate Img * Without Mask

7c382f5e-dc25-446a-a74b-a0db2b8b1edf.png * With Mask

4a05f0b6-ef03-4a18-81d2-2119ce0b1da6.png