public void DrawImage(byte[] rawPixels)
{
if (this.pixelsChangedAction != null)
{
if (this.pixelMapping.Length != rawPixels.Length)
// Incorrect pixel mapping
return;
for (int i = 0; i < rawPixels.Length; i++)
{
int pos = this.pixelMapping[i];
if (pos >= 0 && pos < this.pixels.Length)
this.pixels[pos] = rawPixels[i];
}
this.pixelsChangedAction(this.pixels);
}
}