Printing overlapping lines

Printing overlapping lines

Post by Benoi » Sat, 22 May 2004 00:21:53


Hi,

I'm printing using API and Visual Basic. Here what look the code I use
to print lines:

For lngLine = 1 To X
TextOut lngPrntDC, _
lngCharX, _
-(lngLine * 180), _
strLine, _
Len(strLine)
Next

The 180 is the height of each line. With WindowsNT, even if that
height was smaller than the font height the line was correctly
printed. But with WindowsXP the line is clipped.

I tried, without success, to create the font using the
CLIP_DFA_DISABLE parameter.

There's is any way I can print a line that overlap the previous line
without any clipping?

I'm printing using laser and dot matrix printers.

Thanks!
Benoit P.
 
 
 

Printing overlapping lines

Post by Mike D Sut » Sat, 22 May 2004 19:55:47

> I'm printing using API and Visual Basic. Here what look the code I use
<code snipped>

Have a look at using the DrawText() API in place of TextOut(), and specify the DT_NOCLIP flag. Also rather than explicitly
specifying the line height which may be different depending on the mapping mode of the target printer, use the
GetTextExtentPoint32() API call or if you want explicit spacing then specify an offset in pixels and use the DPtoLP() function to
convert it to the correct offset in logical space on the target context.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: XXXX@XXXXX.COM
WWW: http://www.yqcomputer.com/