Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Picture - Changing Printer Properties

Status
Not open for further replies.

RMS001

Programmer
Nov 12, 2002
45
CA
Hi

I searched the previous posts and while I found a few interesting things, I didn't find an answer to this:

The picture prints with the same resolution (Normal) no matter which setting I choose in the ShowPrinter/Printer Properties Dialog boxes! (My printer prints at up to 1440 and obviously prints at 720 or higher resolutions with Word or Photoshop or even Paint).

VB does not seem to recognize that the properties have been changed.

I am trying to get the printer properties to take effect after changing them in the Properties dialog when using the following code:

Option Explicit
'Form has a Picture box (with a picture) and a Command button

Private Sub Command1_Click()
' Set Printer = Printers(0) '(no effect)
CommonDialog1.PrinterDefault = True
CommonDialog1.CancelError = True
CommonDialog1.Flags = cdlPDPrintSetup
On Error Resume Next
CommonDialog1.ShowPrinter
If Err Then Exit Sub
' Printer.PrintQuality = 720 '(no effect - will not work even without the dialog box)
Printer.PaintPicture Picture1.Image, 300, 300
Printer.EndDoc
End Sub
 

from the help files ...
[tt]
PrintQuality Property


Returns or sets a value indicating the printer resolution. Not available atdesign time.

Syntax

object.PrintQuality [= value]

The PrintQuality property syntax has these parts:

Part Description
Object Anobject expression that evaluates to an object in the Applies To list.
Value A value or constant specifying printer resolution, as described in Settings.


Settings

The settings for value are:

Constant Value Description
vbPRPQDraft -1 Draft resolution
vbPRPQLow -2 Low resolution
vbPRPQMedium -3 Medium resolution
vbPRPQHigh -4 High resolution


In addition to the predefined negative values, you can also set value to a positive dots per inch (dpi) value, such as 300.

Remarks

These constants are listed in the Visual Basic (VB)object library in theObject Browser.

The default value depends on the printer driver and the current settings of the printer. The effect of these settings varies among printers and printer drivers. On some printers, some or all of the settings may produce the same result.

Note The effect of the properties of the Printer object depends on the driver supplied by the printer manufacturer. Some property settings may have no effect, or several different property settings may all have the same effect. Settings outside the accepted range may or may not produce an error. For more information, see the manufacturer's documentation for the specific driver.
[/tt]

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top