public bool ParseResponse(SerialPort serialPort)
{
try
{
StringBuilder sb = new StringBuilder(capacity: 50000);
var s = serialPort.ReadLine();
while (true)
{
s = serialPort.ReadLine().Trim();
if (string.IsNullOrEmpty(s))
continue;
if (s == "OK") break;
sb.Append(s);
}
string bigStr = sb.ToString();
SnapshotImage = MakeBitmap(bigStr);
return true;
}
catch (Exception ex) { MessageBox.Show(ex.Message); return false; }
}