C++ (Qt)void Display::update_screen(){ QByteArray find; find.resize(2); find[0] = 0xFF; find[1] = 0xD8; int begin = read_data.indexOf(find); if (begin == -1) { return; } read_data = read_data.remove(0,begin); find[0] = 0xFF; find[1] = 0xD9; int end = read_data.indexOf(find); if (end == -1) { return; } QByteArray result; result.resize(end); for (int i = 0;i<end;i++) { result[i] = read_data[i]; } QPixmap pxm; pxm.loadFromData(result); read_data = read_data.remove(0,end); Screen->setPixmap(QPixmap(pxm));}