I want to know how can i convert strokeWidth in pixels. Say for example if I set strokeWidth : 1.0 then how do i calculate my strokewidth in pixels.
Actually in my case I will be getting strokeWidth as an input (in pixels) but strokeWidth accepts only numbers but I can do the unit conversion and set strokeWidth accordingly.
The Shape.strokeWidth property cannot directly be converted to any absolute length. Let’s say you set strokeWidth to 1.0, which happens to be the default value. But if you set the GraphObject.scale on that Shape to 2.0, the line will be drawn twice as thick.
Yet if that Shape is in a Panel which is in another Panel that has scale set to 1.5, the line will be drawn with an apparent thickness of 3.0.
But wait – maybe the user has zoomed the diagram out a bit – so that Diagram.scale is 0.5. Then the line will appear to have a thickness of 1.5.
But that’s not all – maybe the user has changed the scale of the HTML page to be 110%. So the line will appear to have a thickness of 1.65.
Finally the browser window is projected onto a screen in a big meeting room, and the line thickness can be measured with a ruler to be about 1cm wide.
So what do you really need to do?