In the program, I need to quickly draw on the image. To do this, I chose WriteableBitmap, and I perform the necessary manipulations with BackBuffer. And everything is drawn safely, as long as the image size does not exceed a certain limit in the region of 1500 pixels. Above this size, instead of the desired shape, something else appears.
writeable.Lock();
IntPtr buff = writeable.BackBuffer;
unsafe
{
byte* pbuff = (byte*)buff.ToPointer();
...
}
writeable.AddDirtyRect(new Int32Rect(0, 0, (int)writeable.Width, (int)writeable.Height));
writeable.Unlock();
At the top of an incorrect result of drawing down approximately as it should look (round brush).
If we do not update the entire image, but only the area you are changing, the result is identical to updating the entire image. What is the problem? Is this a feature of BackBuffer or some other restrictions on the size of WriteableBitmap? And what to do with it if we need very fast rendering on images of 15-30 megapixels? Please do not consider options with Direct2D.