REWARD OFFERED --Win32 printer scaling problem 
Author Message
 REWARD OFFERED --Win32 printer scaling problem

Hi,
I've been just about tearing my hair out over this. I'll be kicking
myself if it turns out to be something super-simple that I've
overlooked.

If anyone can solve this problem,
they get free registration for my software product, GOOSEE.
GOOSEE is free, but I plan some extras that will be useful for
professionals and other serious users, for which there will be a
small registration charge.
My site is:
http://www.*-*-*.com/

Ok, here's the problem. I program in assembly language (no, that
isn't the problem!), but the code here is easy to read.
It's very simple, drawing an ellipse to the printer:

 mov printerdocinfo.cbSize,20
 mov printerdocinfo.lpszDocname,ADDR szfile
 mov printerdocinfo.lpszOutput,0
 mov printerdocinfo.lpszDataType,0
 mov printerdocinfo.fwType,0

 invoke CreateDC, 0,ADDR szname,0,0
 mov hdcprinter,eax
 invoke SetMapMode, hdcprinter,MM_ANISOTROPIC
 invoke SetWindowExtEx, hdcprinter,748,1088,0
 invoke SetViewportExtEx, hdcprinter,4678,6814,0
 invoke StartDoc, hdcprinter,ADDR printdocinfo
 invoke StartPage, hdcprinter
 invoke SetViewportOrgEx, hdcprinter,0,0,0
 invoke Ellipse, hdcprinter, 30,30,500,500
 invoke EndPage, hdcprinter
 invoke EndDoc, hdcprinter

This is essentially the same as I had in my Win16 version of
GOOSEE, that works. The only difference is I used
SetWindowExt() and SetViewportExt() in Win16, and the Win32
versions have an extra parameter, that the docs say is ok to
leave NULL.

What happens with the Win32 version, is that although all these
funcs return a success flag, in fact SetWindowExtEx() and
SetViewportExtEx() are totally ignored. The ellipse is 470 logical
units diameter, which on a 600 dpi printer (I use a HP LaserJet
6P), gives a circle about 0.8 inches diameter. However, it is
SUPPOSED to scale up about six times bigger.

Anyone encountered this before?
Is my reward sufficient to entice anyone to look into it?
There SEEMS to be a subtle difference between the Win16
and Win32 APIs.

Note that if I leave window and viewport origins at 0,0, then
SetViewportOrgEx() is redundant.

Incidentally, if you want to see the advantage of programming in ASM
and using the raw Win32 API, my GOOSEE is a sophisticated GUI
app and C code generator yet is only 180K. I was aghast recently
when I downloaded a zip/unzip app that was 3.5M in zipped form
(FreeZip).

Regards,
Barry Kauler



Sat, 03 Aug 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. C homework help - Reward offered

2. Problems Setting the Default printer with Win32 API SDK

3. Of printers and scaling

4. How to scale printer text?

5. Of printers and scaling

6. Of printers and scaling

7. An LSU Medical Center C++ Coding SOS (much-coveted REWARD offered as well) - sos.zip (1/1)

8. Marshal Win32 API EnumPorts Printer

9. Print on Irda printer throught win32

10. bitmap printing fine on color printer, but never got gray scaled on mono printer.

11. scaling problem

 

 
Powered by phpBB® Forum Software