Link to home
Start Free TrialLog in
Avatar of RainUK
RainUK

asked on

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???
SOLUTION
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RainUK
RainUK

ASKER

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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RainUK

ASKER

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.