_t>(max(0, min(255, b_val)));dst_rgba_row[x * 4 + 3] = 255;}} } 三、图片显示 这里用Windows GDI的方式把图片直接绘制在窗口上 CBitmap...用的是BGRA格式的数据,显示I420的话,把格式转换一下再组装为CBitmap即可。...void CPicViewerDlg::DrawBitmap(CWnd *pWnd, int x, int y, int w, int h, unsigned char *pData){CBitmap...bitmap.CreateBitmap(w, h, 1, 32, pData);CDC *pWndDc = pWnd->GetDC();MemDc.CreateCompatibleDC(pWndDc);CBitmap