Open
Description
The Example2. CSharpMath.SkiaSharp, apart from having syntax errors, doesn't say anything. Suggest to replace it with the following.
using CSharpMath.SkiaSharp;
using SkiaSharp;
//...
void DrawSample()
{
var p = pictureBox; // exists a PictureBox with name pictureBox
// create canvas
var imageInfo = new SKImageInfo(p.Width, p.Height);
using var surface = SKSurface.Create(imageInfo);
using var canvas = surface.Canvas;
var painter = new MathPainter {
LaTeX = @"\frac\sqrt23"
};
painter.Draw(canvas);
using var snapshot = surface.Snapshot();
using var image = snapshot.Encode(SKEncodedImageFormat.Png, 100);
using var stream = new MemoryStream(image.ToArray());
p.Image = new Bitmap(stream, false);
}