Printing alpha & transparent images on printer

Printing alpha & transparent images on printer

Post by Matija Tomaskov » Mon, 28 Jun 1999 04:00:00


Hi!

I wonder how to print (on printer) some text and few 24bit bitmaps
(over that text) using alpha and transparent blits.

Without transparency and alpha, I'll do (I'm doing) something like
this:

//---cut---------------------------------------------------
// create and prepare printer DC
// StartDoc
// StartPage

... do pDC->TextOut
... do pDC->StretchDIBits (blit DIB to DC)

// EndPage
// EndDoc
//---cut---------------------------------------------------

The problem is when I want to do transparent blits or blits using
alpha =8-|. I did 24bit to 24bit (DIBs) transparent blit and alpha
blit routines, but I'm not sure whether rendering manually
such image for printer is a right way (i.e. - creating
A4-600x600-24bit image (95MB!) and then using my alpha
and transparent DIB stretching routines).

I've read that operations (TextOut, StretchDIBits) on printer DC are
saved in temporary Enhanced metafile, so, there is actually no
bitmap underneath printerDC (it will be created by printer driver,
later - and sometimes using bands?!).

Any tips?

-<<< Matija Tomaskovic >>>------------------------------------------------

-----------------------------------------------------------<<< Mataya >>>-

 
 
 

Printing alpha & transparent images on printer

Post by Petr Novotn » Tue, 29 Jun 1999 04:00:00



Quote:> Hi!

> I wonder how to print (on printer) some text and few 24bit bitmaps
> (over that text) using alpha and transparent blits.

[snip]

Quote:> I've read that operations (TextOut, StretchDIBits) on printer DC are
> saved in temporary Enhanced metafile, so, there is actually no
> bitmap underneath printerDC (it will be created by printer driver,
> later - and sometimes using bands?!).

1. You can't rely on doing StretchDIBits with other than SRCCOPY mode.
(SRCPAINT may not work.)
2. Therefore you should create a bitmap of the whole page and print that
bitmap with SRCCOPY
3. The bitmap will be too large :-)
4. Work with stripes - rule of thumb says to stay under 2MB size
5. Of course, sending truecolor data to a printer is an overkill, and may
stuff the print server when printing to network printer. Consider reducing
the number of colors.

 
 
 

1. What's the transparent color to use if your image has a transparent background

Hi,

I'm trying to use the CImage::TransparentBlt() method on WinXP.  The
last parameter of this method requires a color that the API will treat
as "transparent".

My question is, what's the transparent color if my image was created
in Photoshop with a transparent background.  When I run my cursor of
the transparent background, Photoshop doesn't show any values for the
RGB components.

To test, I loaded my image using CImage::Load() and do a
CImage::GetPixel(0,0).  Pixel (0,0) is transparent according to
Photoshop.  But when my image is loaded, CImage::GetPixel(0,0) said
that it has a RGB(255,255,255) value - which is white.

Anyone has any pointers on this?

Thanks,
Cher Wah.

2. How to know when a WinExeced app. stops?

3. Printer Pool - Print to multiple printers usings 1 print driver?

4. Easy Cd Creator Locks System

5. Program needed to print an image to my printer driver.

6. Jazz Drives Good or Bad?

7. Whats the best method to print Trasnparent images on printers using Win32

8. SMART FOLDER VERSIONING

9. Run time error 486: Can't print form image to this type printer

10. Transparent windows with alpha shadows.

11. Help: multiplatform Visual C++ IDE & NMAKE builds (alpha&intel)

12. How to define in the printer driver spool settings: Print Directly to printer.

13. Images/icons with Alpha channel