private void SetPixelLine(Frame frame, int x, int yPtr, int color)
{
switch (frame.PixelFormat)
{
case (PixelFormat.Format24bppRgb):
{
int ptr = yPtr + x * 3;
if(ptr >= 0 && frame.Data.Length > ptr + 2)
{
frame.Data[ptr++] = (byte)color;
frame.Data[ptr++] = (byte)(color>>8);
frame.Data[ptr] = (byte)(color>>16);
}
break;
}
default:
throw new NotSupportedException();
}
}