You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bitmap b = new Bitmap(100, 100);
var graphics = Graphics.FromImage(b);
graphics.Clear(Color.Black);
graphics.DrawLines(new Pen(Color.Red, 1), new[]
{
new PointF(0, 0),
new PointF(100, 0)
});
b.Save("test_SD.bmp");
SkiaSharp with y-offset of 0
var image = new SKBitmap(new SKImageInfo(100, 100, SKColorType.Rgba8888));
var canvas = new SKCanvas(image);
canvas.Clear(SKColors.Black);
SKPaint thinLinePaint = new SKPaint
{
Style = SKPaintStyle.Stroke,
Color = SKColors.Red,
StrokeWidth = 1
};
canvas.DrawLine(0, 0, 100, 0, thinLinePaint);
canvas.Flush();
using (var save = SKImage.FromBitmap(image))
using (var data = save.Encode(SKEncodedImageFormat.Png, 100))
{
// save the data to a stream
using (var stream = File.OpenWrite("testSkia0.png"))
{
data.SaveTo(stream);
}
}
The text was updated successfully, but these errors were encountered:
Adding the following code to the method before scaling fixes this particular issue. The line is placed correctly and is 1px thick.
if(width<=1F){width+=.5F;}
However, we now have a difference of about 0.3% - 1.6% in fine pen writing with 3 failing tests. The stroke width appears to be the same but the antialiasing is heavier.
I plan to try to take a look over this issue this weekend, I think I need to create some comparisons with of other libs and see where we differ and how.
Prerequisites
DEBUG
andRELEASE
modeDescription
I'm trying to draw some non-antialiased 1px lines.
Steps to Reproduce
Actual output:
Expected:
System Configuration
For comparison, output from other cases follows:
Using y-offset of 1
System.Drawing with y-offset of 0
SkiaSharp with y-offset of 0
The text was updated successfully, but these errors were encountered: