printing with Python/Windows

Sasha Voynow svoynow at yahoo.com
Wed Jul 21 16:17:33 EDT 1999


 Roger:

    Wow. Excellent.
Another example of the excellence of comp.lang.python and it's
contributors.

Sasha


I'll have to take a look at this script and see if I can
> >modify it for
> >"unattended" execution, as that is what I'm really after.
> >
>
> Okay, done.  See my web site:
>
> http://starship.python.net/crew/roger/
>
> for DisplayImage.py.  From the doc:
>
>
> Image Display and Printing demo.
>
> Demonstrates a number of techniques for displaying and printing images
using
> the PythonWin MFC framework.  This method of printing is suitable for
> "automatic" printing, and so, uses the default printer settings.
>
> As this was ripped out of a larger app, I left some other stuff in as
well:
>     *) The pixel value under the cursor is displayed in the title bar.
>     *) You can draw up to four circles on the image using the mouse.
>     *) After four circles are drawn, you can drag them to new locations.
>     *) You can delete a circle with the delete or backspace key.
>     *) Right click on the image to get an options menu (print only for
now).
>
> Usage:
>     from the windows command line:
>         PythonWin.exe /app path/DisplayImage.py [-p -m mag] [imagePath]
>         where:
>             path:      The directory containing this script.
>             -p:        If present, print the image and exit.
>             -m mag:    Only used if -p present, the magnification to print
at,
>                        defaults to 3.
>             imagePath: The image to open and display.
>         You may need to supply the PythonWin.exe path as well.
>         If you use the -p option, you must supply the imagePath as well.
>         If no imagePath is given, an open file dialog is used to get the
image.
>
>     from the Python/PythonWin command prompt (or, within a script):
>         import DisplayImage
>         DisplayImage.displayImage() # Use file dialog to get and display
an
>                                     # image
>         DisplayImage.displayImage(imgPath) # display given image
>         DisplayImage.printImage(imgPath, mag) # print image at mag.
>
> Requires:  PIL (Python Imaging Library)
>            PythonWin (Build 125 or later)
>
>
>
> Cheers,
>
>
> Roger Burnham
> Cambridge Research & Instrumentation
> rburnham at cri-inc.com
> http://www.cri-inc.com/
> http://starship.python.net/crew/roger/
> PGP Key: http://www.nai.com/default_pgp.asp
> PGP Fingerprint: 5372 729A 9557 5F36 177F  084A 6C64 BE27 0BC4 CF2D






More information about the Python-list mailing list