mikkon
asked on
Using wide pens on anisotropic DC's
I have a DC that uses anisotropic mapping mode. I am trying to draw lines wider than 1 pixel onto this DC as follows:
ptarray[0].x=ptarray[0].y= 0;
...
ptarray[5].x=2; // Pen width
ptarray[5].y=0;
DPtoLP (hDC,ptarray,6);
HeavyPenWidth=ptarray[5].x -ptarray[0 ].x;
hBluePen2=CreatePen(PS_SOL ID,HeavyPe nWidth,Dis abled?RGB( 128,128,12 8):RGB(0,0 ,128));
This works fine on Windows 95: the lines drawn with the pen look nicely "bold" compared to 1-pixel lines. However, on Windows NT, the lines drawn with the pen are HeavyPenWidth logical units wide and high. Because my mapping mode is far from the screen's aspect ratio, vertical lines are drawn wide, but horizontal lines are much thinner.
Is there a way of specifying the pen widths in device units? Changing the mapping mode is out of question.
ptarray[0].x=ptarray[0].y=
...
ptarray[5].x=2; // Pen width
ptarray[5].y=0;
DPtoLP (hDC,ptarray,6);
HeavyPenWidth=ptarray[5].x
hBluePen2=CreatePen(PS_SOL
This works fine on Windows 95: the lines drawn with the pen look nicely "bold" compared to 1-pixel lines. However, on Windows NT, the lines drawn with the pen are HeavyPenWidth logical units wide and high. Because my mapping mode is far from the screen's aspect ratio, vertical lines are drawn wide, but horizontal lines are much thinner.
Is there a way of specifying the pen widths in device units? Changing the mapping mode is out of question.
ASKER
Of course, you mean converting logical coordinates to device coordinates (LPtoDP), changing the mapping mode to MM_TEXT, drawing the line with device coordinates and changing back to the original mapping mode. Sound good; answer this question and you'll get the points.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Isn't there a way to remap the old mapping mode manually to pixels? Then you'd just
need to recalculate the new line origins and draw it, and then change back to the old mode.
This should be possible, as the mapping mode is just a mathematic transformation.