CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    42

    TransparentBlt return false in some printer devices.

    I am using the function TransparentBlt of CImage class and in a lot of printers the bitmaps are printed in transparency correctly. But in some printer devices TransparentBlt function return false (for example Adobe PDF 6.0) and therefore the bitmaps are not printed. What can be the problem? How I can know if the printer will print correctly the bitmaps?

    This is my code:

    void DrawTranspBm(CDC * pDC, const CRect* pRt, COLORREF crColour, HBITMAP hBitmap)
    {
    CImage img;
    img.Attach(hBitmap);
    BOOL bRet=img.TransparentBlt(pDC->GetSafeHdc(),*pRt,crColour);
    }

    Can any help me please?
    Thanks.

  2. #2
    Join Date
    Apr 2009
    Posts
    598

    Re: TransparentBlt return false in some printer devices.

    Yes, some printers don't have transparent ink nor do they have other means for simulating a transparent area.
    Use BitBlt() instead of TransparentBlt() although the result might be somewhat different.

  3. #3
    Join Date
    Feb 2007
    Posts
    42

    Re: TransparentBlt return false in some printer devices.

    Thanks for the reply. If I use BitBlt also fail and if I use StretchBlt I don't get the result that I need. How can I know before to print some document If the printer that I am using can use correctly TransparentBlt function or not? I am comparing two printer devices (one printer devices print transparent bitmaps correctly and the other no) using GetDeviceCaps function I only see differences in this parameters (The results of GetDeviceCaps with the others parameters are the same in the two printers):

    Printer ok Printer fail
    LOGPIXELSX 600 1200
    LOGPIXELSY 600 1200
    ASPECTX 600 1200
    ASPECTY 600 1200
    ASPECTXY 846 1696
    HORZRES 4958 9917
    VERTZRES 7016 14031

    Can any help me please? Thanks.

  4. #4
    Join Date
    Feb 2005
    Posts
    2,160

    Re: TransparentBlt return false in some printer devices.

    Even SHADEBLENDCAPS is the same in both?

  5. #5
    Join Date
    Feb 2007
    Posts
    42

    Re: TransparentBlt return false in some printer devices.

    Thanks for the reply.

    Yes, in both printers are 0.

    Can any help me please?
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured