image shown on print preview but not printed 
Author Message
 image shown on print preview but not printed
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....) .........

Quote:
}




Fri, 30 Apr 2004 01:04:01 GMT  
 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



Fri, 30 Apr 2004 02:18:11 GMT  
 image shown on print preview but not printed
Use LoadImage with LR_CREATEDIBSECTION to create a DIB section, instead of
DDB. Then attach to a CBitmap.

To use StretchDIBits, you have to load the bitmap as DIB.

Feng Yuan www.fengyuan.com

This posting is provided "AS IS" with no warranties, and confers no rights.



Fri, 30 Apr 2004 07:21:34 GMT  
 image shown on print preview but not printed
I appologize for clustered postings, but I discovered something (not so?)
new again..

When I do this...
  pDC->SetMapMode(MM_ANISOTROPIC);
  pDC->SetWindowExt(1, 1);
  pDC->SetViewportExt(1, 1);

Is this equal of doing nothing at all?

My problem in the first place was that on some other printer (to which I
don't have access right now) page is printed with scale twice as big as
normal. I couldn't force MM_HIMETRIC to work good on my system, so I tried
MM_ANISOTROPIC like above. Will this fix my problem? I'm suspicious that it
won't, I think I'll have to get MM_HIMETRIC to work. Because thi mapping
mode uses milimeters in printer context and this should work all right for
all printers.

I'm quite desperate and I don't have time for experimenting, because I have
to learn for math exam :(
;)))

---...---  (SOS !!!!)

David



Wed, 05 May 2004 03:20:15 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Printing Text and images, images not printing

2. Printing Text and images, images not printing

3. Reversing the print/print preview image

4. Reversing Image for Print and Print Preview

5. Print Preview does not show the clipped objects.

6. Print preview does not match print output

7. Print Preview Control and Print Preview Dialog - need some help ASAP

8. MainFrm shows all its toolbars after Print Preview

9. CRichEditView:: Font shown in print preview same as screen font

10. Toolbars show up after Print Preview is closed

11. Print Preview and 24 bit images

12. Adding Print and Print Preview to Richedit Control

 

 
Powered by phpBB® Forum Software