void CfingerDlg::OnPaint() {
CPaintDC dc(this);
p = pImage;
for(i = imstartY; i < Height/ImageFactor; i++){
for(j = imstartX; j < Width/ImageFactor; j++){
c = *(p + i*ImageFactor*Width + j*ImageFactor);
c = ((c & 0x0007)<<21) | ((c & 0x0007)<<13) | ((c & 0x0007)<<5);
if (((j+LcdStartX)<LcdHeight) && ((i+LcdStartY)<LcdWidth))
{
dc.SetPixel(i,LcdHeight-j,c);
}
}}}}mfc窗口重绘 怎么才能转成bmp在picture box显示?
CPaintDC dc(this);
p = pImage;
for(i = imstartY; i < Height/ImageFactor; i++){
for(j = imstartX; j < Width/ImageFactor; j++){
c = *(p + i*ImageFactor*Width + j*ImageFactor);
c = ((c & 0x0007)<<21) | ((c & 0x0007)<<13) | ((c & 0x0007)<<5);
if (((j+LcdStartX)<LcdHeight) && ((i+LcdStartY)<LcdWidth))
{
dc.SetPixel(i,LcdHeight-j,c);
}
}}}}mfc窗口重绘 怎么才能转成bmp在picture box显示?
CPaintDC dc(this);
CDC memdc;
memdc.CreateCompatibleDC( &dc );
CRect rc;
GetClientRect( &rc );
CBitmap bmp;
bmp.CreateCompatibleBitmap( &dc, rc.Width(), rc.Height() );
CBitmap *pOld = ( CBitmap * )memdc.SelectObject( &bmp ); p = pImage;
for(i = imstartY; i < Height/ImageFactor; i++){
for(j = imstartX; j < Width/ImageFactor; j++){
c = *(p + i*ImageFactor*Width + j*ImageFactor);
c = ((c & 0x0007) < <21) | ((c & 0x0007) < <13) | ((c & 0x0007) < <5);
if (((j+LcdStartX) <LcdHeight) && ((i+LcdStartY) <LcdWidth))
{
memdc.SetPixel(i,LcdHeight-j,c);
}
}}}
dc.BitBlt( 0, 0, rc.Width(), rc.Height(), &memdc, 0, 0, SRCCOPY );
memdc.SelectObject( pOld );
}