Printing transaprent GIFs to PCL and PostScript

Hi,
 
we get a HDC from a previously opened printer using the correct defaults struct and access rights.
we attach this HDC to a CDC which we will use to write to.
next we load an image from a file (JPG) into a CImage object. this JPG is not transparent. we then render this image onto the CDC (which has been prepared as in CView::OnPrepareDC to the doc extents that we desire).
again, we load another gif (this time a transparent gif) into a CImage object and render that one using the same coordinates as the previous. i.e. it should be drawn on top of the first image (we do the render with CImage::Draw(dc, rect)).
 
now - we expect the printout to show the underlying image and the transparent image on top.
 
using PCL printer drivers for both OKI and HP printers this is the case. the transparent image is drawn correctly. however, using PostScript drivers for the same printers the transparent gif (i.e. the 2nd one) is rendered transparent but has a transparent border area, thereby blocking out the underlying image from being printed - not what we want. however, this behaviour only occurs with overlapping pictures. if part of the transparent gif is drawn over coloured paper it will be rendered as transparent.
 
 
furthermore, we wish to draw text onto our CDC. we use the CDC::DrawText function to do this (we create the required CFont before hand and select it into our CDC). what we find here is that for PS drivers the resulting text comes out perfect but for the PCL drivers the text is unevenly spaced. why???
LVL 5
RainUKAsked:
Who is Participating?
 
Roshan DavisConnect With a Mentor Commented:
>> basically it seems to have bitblt, but I print and nothing appears on the paper.
Ohh Yes.

For printing you have to create the Device Independent Bitmap. Normal blitting images are device dependent....

This will help

http://www.codeproject.com/printing/printingtricksandtips.asp - Printing tips and tricks from the trenches

Copy that function *DDBToDIB* and ::StretchDIBits function part from that Link.

Good luck
0
 
Roshan DavisConnect With a Mentor Commented:
I think you are blitting images 2 times in the Printer DC for an overlapping image.
This is just a try out, Draw the entire to a memory DC, and blitting that to the PrinterDC.
Rosh :)
0
 
RainUKAuthor Commented:
Hi Roshmon,

Having problems BitBilting from one dc to another dc. ANy simple sample code, basically it seems to have bitblt, but I print and nothing appears on the paper.
0
 
RainUKAuthor Commented:
Hi Roshmon,

It was actually a printer driver problem from OKI. It does not work properly with Arabic locale which is causingt he problems. But thanks for the help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.