locked
Sharp thin line in silverlight 4 RRS feed

  • Question

  • Hi

    any idea how to show a sharp thin line in SL4, I tried using StrokeThickness =0.5, but the line disappers in SL4.

    I want to show a thin sharp line

     

    thanks

    Wednesday, July 28, 2010 6:00 AM

Answers

  • How exactly did you expect a line to remain sharp when you've specified its width as being less than one pixel?

    Given the way pixels work in most monitors, the sharpest lines can be achieved in Silverlight by using either horizontal or vertical lines, of width 1px, centred on a half-pixel so they occupy the entire pixel. If you centre them on a pixel boundary they will attempt to half occupy both neighbouring pixels, resulting in blurriness. 

    Wednesday, July 28, 2010 6:41 AM

All replies

  • How exactly did you expect a line to remain sharp when you've specified its width as being less than one pixel?

    Given the way pixels work in most monitors, the sharpest lines can be achieved in Silverlight by using either horizontal or vertical lines, of width 1px, centred on a half-pixel so they occupy the entire pixel. If you centre them on a pixel boundary they will attempt to half occupy both neighbouring pixels, resulting in blurriness. 

    Wednesday, July 28, 2010 6:41 AM
  • You propably had a same problem as I. My lines in silverlight was not sharp because i dont watch site at 100% size (without zoom). You should change a zoom level of specyfic page at yours browser to 100% (ctrl+0) or in menu. Stupid mistake :/

    Sunday, November 7, 2010 12:44 PM