Harline - how do I print one?

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi,

I am trying to print a line which is 1 (device) pixel wide.

I'm using a printer hdc that has had scaling applied, thus:

PageWidth = Printer.ScaleWidth
PageHeight = Printer.ScaleHeight
OldMapMode = SetMapMode(Printer.hDc, MM_ISOTROPIC)

Success = SetViewportOrgEx(mHdc, 0, 0, OldViewOrg)
Success = SetWindowExtEx(mHdc, PageWidth, PageHeight, OldWinExtent)
Success = SetViewportExtEx(mHdc, PageWidth, PageHeight, OldVpExtent)
Success = ScaleViewportExtEx(mHdc, PageWidth, MyForm.ScaleWidth, PageWidth, MyForm.ScaleWidth, OldSize)

The scaling is working, but it means the thickness of a pen created with nWidth=1 is also scaled up.

Is it possible to create a pen which is 1 device-pixel wide?

According to the MSDN entry for CreatePen:
"If the value specified by the nWidth parameter is zero, a line drawn with the created pen always is a single pixel wide regardless of the current transformation"

This statement doesn't appear to be true if the device is a printer.

Adelle.
.