This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10|Reply: 0

[.NET Core] .NET/C# Use SixLabors.ImageSharp to add watermark text to images

[Copy link]
Posted on1 hour ago | | | |
Requirements: Back in the .NET Framework era, a lot of code was written to add watermarks to images, all implemented on Windows. Now that .NET Core has crossed platforms, how do you add text watermarks to images? How can it run normally on Linux systems? This article uses SixLabors.ImageSharp to add watermark text to images.

First, it is necessarySpecify the version of the SixLabors.ImageSharp library, higher versions require a license. Nuget quoted as follows:

The implementation code is as follows:
As shown below:



Use Arial fonts on Windows and DejaVu Sans fonts on Linux. The commands to install DejaVu-related font libraries on Linux are as follows:

Both DejaVu Sans and DejaVu Serif fonts are free. They are released under the GNU Lesser General Public License (LGPL), meaning you are free to use, distribute, and modify these fonts. The DejaVu font project aims to provide a high-quality open-source font covering character sets in multiple languages. These fonts are widely used in various operating systems and applications, including Linux distributions. If you need to use these fonts for your project or personal purposes, usually no fees are required.

For the latest version of SixLabors.ImageSharp to add text watermarks, refer to:The hyperlink login is visible.




Previous:Charles Schwab Account Application and Deposit Tutorial
Next:.NET/C# Use itext to add text watermarks to PDFs
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com