-
-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Description
I need to send a text to a 128x64 LCD display. I need to generate a bmp and draw some text over. I first use System.Drawing but due to problems with windows nano container I migrate the code to SixLabors.ImageSharp.
The resulting text with SixLabors.ImageSharp don't display smoothly like System.Drawing
Removing HorizontalAlignment and VerticalAlignment helps but it still doesn't show it correctly.
At left the version using System.Drawing, at the right using SixLabors.ImageSharp
Steps to Reproduce
using (var img = new Image<Rgb24>(128, 64, Color.White)) {
img.Mutate(x => x.DrawText(new TextGraphicsOptions() {
TextOptions = new TextOptions() {
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
WrapTextWidth = img.Width,
ApplyKerning = true,
DpiX = 100,
DpiY = 100,
},
GraphicsOptions = new GraphicsOptions {
Antialias = false,
ColorBlendingMode = PixelColorBlendingMode.Normal
}
}, "Lorem ipsum dolor sit amet", SystemFonts.CreateFont("Tahoma", 8, FontStyle.Regular), Color.Black, new Point(0, 31)));
img.SaveAsPng(filepath);
}
System Configuration
-
ImageSharp.Drawing version:
SixLabors.ImageSharp Version=1.0.3
SixLabors.Fonts Version=1.0.0-beta0013
SixLabors.ImageSharp.Drawing Version=1.0.0-beta11 -
Other ImageSharp packages and versions: I tested with packages from MyGet with the same result
SixLabors.Fonts Version=1.0.0-beta13.5.1
SixLabors.ImageSharp Version=1.0.3
SixLabors.ImageSharp.Drawing Version=1.0.0-beta11.8 -
Environment: Windows 10 & Windows Nano Server
-
.NET Framework version: .Net 5.0