?
Solved

Using wide pens on anisotropic DC's

Posted on 1998-10-01
3
Medium Priority
?
202 Views
Last Modified: 2013-12-03
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_SOLID,HeavyPenWidth,Disabled?RGB(128,128,128):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.
0
Comment
Question by:mikkon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:snoegler
ID: 1414943
No, there isn't. At least not using GDI functions - you _will_ need to change the mapping mode.
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.
0
 
LVL 1

Author Comment

by:mikkon
ID: 1414944
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.

0
 
LVL 6

Accepted Solution

by:
snoegler earned 400 total points
ID: 1414945
Thank you - I forgot this LPtoDP function, which does the mapping for you. So i think 50% of
the points should go to yourself - but this isn't possible :)
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question