PDA

View Full Version : Setting pen width in mm/inches instead of in pixels



mangeshj
2nd February 2011, 07:24
I have data in mm/inches and I need to set pen width in mm/inch units and not in terms of pixels. The functions in QPen(setWidth and setWidthF works on pixels). Is there any conversion from mm/inch value to pixel(e.g., when i say 1mm, the line drawn should be 1 pixel wide) or is there any way to set pen width in mm/inch units.

Thanks,
Mangesh

Lykurg
2nd February 2011, 07:41
It depends on where you use the painter. If it is on a "paper" for printing, you know the resolution in ppi. Some simple math lead you then to how many pixels are a mm.