Delayed rendering of the image in ASP.Core #1975
-
I'm trying to draw a set of images with SkiaSharp, convert them to byte array, and send to
Here is the Web API controller. Uncommenting second Also, this is not an ASP issue, because I tried rendering images with System.Drawing.Common and images were rendered in real time without delay. Does anybody know what is missing in this method?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Docs for Either call I would dispose the canvas as well to make sure all drawing is flushed, maybe it's not essential here but it's a good practice. |
Beta Was this translation helpful? Give feedback.
Docs for
SKImage.FromBitmap
say it can make a copy of the pixels, so you are sending back the image as it looked before you started drawing on the canvasEither call
SKImage.FromBitmap
only after drawing is done, or possibly just useSKBitmap.Encode
to encode directly from the bitmapI would dispose the canvas as well to make sure all drawing is flushed, maybe it's not essential here but it's a good practice.