Help with writing a Windows NT 4.0 Printer Graphics Driver

Help with writing a Windows NT 4.0 Printer Graphics Driver

Post by T. S. Li » Sat, 11 Jan 1997 04:00:00

I hope this is appropriate newsgroup for this posting.

I am building a Windows NT 4.0 Printer driver that basically lets GDI
render into a bitmap.  I am not using the Unidriver approach because of
certain limitations, hence I am basing this driver on the Postscript and
FrameBuffer source.  For now, the bitmap is 1 Bit Per Pixel (Monochrome),
and later I would like it to be configurable to 24 Bits Per Pixel.

So far, my driver is working pretty well except for 1 thing.  Somehow, GDI
is not halftoning or dithering into the bitmap.  I am probably not setting
something correctly in GDIINFO or DEVINFO at DrvEnablePDEV().  

I am setting the following:
        devinfo.iDitherFormat = BMF_1BPP;
        // my driver does not create its own brush
        devinfo.cxDither  = 0;
        devinfo.cyDither  = 0;

        devinfo.hPalDefault = EngCreatePalette(PAL_RGB, 0, 0, 0, 0, 0);         // <--Is
this right???

        gdiinfo.ulHTPatternSize = HT_PATSIZE_8x8;               // Tried others, still same
        gdiinfo.ulHTOutputFormat = HT_FORMAT_1BPP;              
        gdiinfo.ulHTFlags = HT_FLAG_HAS_BLACK_DYE;      

        gdiinfo.ulNumColors = 2;
        gdiinfo.cBitsPixel = 1;

        gdiinfo.ulDACRed = 8;           // Are these applicable to printers????
        gdiinfo.ulDACGreen = 8;
        gdiinfo.ulDACBlue = 8;

        gdiinfo.ulNumPalReg = 2;

I searched thru' the DDK/MSDN documentation, and I am confounded by this
problem.  I would appreciate any help.


T. S. Lim


1. Help with developing a simple NT 4.0 printer driver

I need to develop a simple NT 4.0 driver that produces a .BMP of the
printed page. I've developed one for NT 3.51 and Windows 95. However, the
new kernel-mode driver model under 4.0 has me quite perplexed. The DDK does
not have any relevant samples and the documention on how to convert the
3.51 driver is poor as well. Any help would be appreciated. I can offer the
3.51 source in trade for a good 4.0 example.


(ActiveX FAQ)

2. To Ares FondMinder Fans

3. Help - how to write a printer driver for NT

4. Installing Bind

5. Help: How to write a bitmap printer driver on NT??

6. How to find ILS servers

7. Windows 98 Drivers Compared with NT 4.0 and 5.0 Drivers

8. Eventlog error

9. Porting Win95 printer driver & port monitor to NT 4.0

10. Can NT 4.0 Printer Driver Perform File I/O?

11. help regarding the Printer driver in Windows - NT

12. Looking for FULL raster printer driver source for NT 4.0

13. Looking for bitmap printer driver source for NT 4.0