Replies: 4 comments
-
This is because both the surface canvas an the bitmap needs to be cleared. In you code, you are clearing the canvas, and then drawing a uninitialized bitmap. This may just be because this is just a snippet, but what is the reason for creating the bitmap? If the drawing in the bitmap is not transparent, such as with clear white, then you don't need to clear the surface - saving on that processing. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi, I confirm this issue as explained in wieslawsoltes/Svg.Skia#28 While it is expected a newly initialized element in C contains random memory you expect the contrary in C#, SKCanvas should be clear on Regards |
Beta Was this translation helpful? Give feedback.
-
You might try clearing both, bitmap and canvas, before drawing. skBitmap.Erase(SKColors.Transparent);
skCanvas.Clear(SKColors.Transparent); |
Beta Was this translation helpful? Give feedback.
-
I have an SKContol in a Windows Form. After drawing the bitmap to the canvas and Invalidating the control, I am often seeing speckles in the image similar to this:
This happens on the PaintSurfaceEvent. I also see these random speckles when drawing an empty bitmap to the canvas. Here is the code I use to draw to the bitmap to the canvas in the paint event:
I can also verify that the speckles also appear on Android device too, not just windows.
Is there a work around to get rid of this, or is this a problem with drawing?
Beta Was this translation helpful? Give feedback.
All reactions