The problem is that you need to know what size the image has to be for your printer. The image size will be in pixels, and your printer might print at different "pixels per inch" (dots per inch), per cm, etc.
So you need to decide what resolution you'll use to print. Then take that resolution per unit of linear measure (inches, cm, etc.), multiply it by the horizontal and vertical psper size in linear measurements (inches, cm), and that give you the size in pixels you need to scale the image to before printing.
Since printers often have borders they will not print in, you might have to adjust the "paper size" dimensions a little smaller to accomodate this.
Now, your program will need to fetch the information for your printer and paper since they aren't universal values. From there you can calculate the required dimensions in pixels and do your scaling.
The print spooler can provide this information to your program. DeviceCapabilities() in winspool.drv can provide paper sizes in units of 1/10 mm for you to work with. Here's a demo program that retrieves such information:
You'd fetch the 3 types of info (paper ID, paper name, paper sizes) and then use the paper ID value if you know it to look up its index in the table, then use that index to get the sizes. If you haven't hard-coded your paper's ID you may need to scan the paper names list to get the index.
But none of this is related to WIA scanning at all. It's printer stuff and needs a VB6 question thread of its own rather than an off-topic discussion here.
You'd also need your printer resolution so I've updated the attachment to retrieve that as well.
Last edited by dilettante; Jun 18th, 2013 at 05:26 PM.
Reason: added code to fetch printer's resolutions
In the 'SaveCard' program is it possible to replace an existing file with the same file name ? WiaImageFile.Savefile saves the file. But it does't allow if already a file is existing with the same name. Kindly reply.