In examples of user interface, we can see these lines:
var ptr = Memory.UnmanagedMemory.Allocate(640 * 480 * 2);
var data = Memory.UnmanagedMemory.ToBytes(ptr, 640 * 480 * 2);
I suppose it is to use unmanaged memory to display application, but how application can know data is buffer to display ? It isn’t used after. Is Something missing in example ?
var screen = Graphics.FromHdc(display.Hdc);
var controller = I2cController.GetDefault();
var ptr = Memory.UnmanagedMemory.Allocate(640 * 480 * 2);
var data = Memory.UnmanagedMemory.ToBytes(ptr, 640 * 480 * 2);
ptr and data are unused ? (As screen Which use graphics use already unmanaged)
As data is never used again.