March 2018
Beginner to intermediate
410 pages
10h 40m
English
To return a dynamic image we need to be able to draw it. SkiaSharp is a powerful cross-platform two-dimensional drawing engine. It will allow us to draw graphs and create images. Add the SkiaSharp NuGet package to the project. The SensorHttp project, in the GitHub repository for this book, contains a GenerateGauge()method that draws a gauge using SkiaSharp, based on the current momentary values. The method returns an object of type SKImage. Returning the image to the requester can be done very simply, as follows:
private void ReturnMomentaryAsPng(HttpRequest Request,
HttpResponse Response)
{
Response.Return(this.GenerateGauge(Request.Header));
}
What happens when you return an object is that the web server checks ...
Read now
Unlock full access