
image shown on print preview but not printed
Quote:
> hi,
> I have problem printing one bmp. Like said in the subject, everything is
> perfectly OK on print preview, but then when printed, this image is
missing.
> What could that be?
> void CEldataView::OnPrint( CDC *pDC, CPrintInfo *pInfo )
> {
> CEldataDoc* pDoc = theApp.m_pDoc;
> ASSERT_VALID(pDoc);
> int katera_stran;
> if(pInfo->m_nCurPage > (unsigned int)vect_strani_za_tiskanje.GetSize())
> katera_stran = 0; else
> katera_stran = vect_strani_za_tiskanje[pInfo->m_nCurPage-1];
> CDC memDC;
> CBitmap bmp;
> bmp.LoadBitmap(IDB_ELDATA_LOGO);
> memDC.CreateCompatibleDC(pDC);
> memDC.SelectObject(&bmp);
> pDC->StretchBlt(500,200,3*382,3*80,&memDC,0,0,382,80,SRCCOPY);
> //other stuff (which does get printed....) .........
> }
ok, I realize now that I'll have to use StretchDIBits(...) instead:
I have trouble using it correctly, would someone please translate this code:
CDC memDC;
CBitmap bmp;
bmp.LoadBitmap(IDB_ELDATA_LOGO);
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(&bmp);
pDC->StretchBlt(500,200,3*382,3*80,&memDC,0,0,382,80,SRCCOPY);
Into code using StretchDIBits(...) instead of StretchBlt(...)
Please, please, please