NarrowBarWidth Property

Navigation:  Reference Guide > Properties >

NarrowBarWidth Property

Previous pageReturn to chapter overviewNext page

Gets or sets the narrow bar width in centimeters.

[Visual Basic .NET]

Public Property NarrowBarWidth As float

[C#]

public float NarrowBarWidth {get; set;}

 

Remarks

The default value is 0.07, internally our barcode ASP.NET web control converts narrow bar width from centimeters to pixels based on the device resolution, round up or round down float pixel value to the nearest integer.

 

The centimeter to pixel conversion formula is :

size_in_pixels = size_in_centimeters * device_resolution / 2.54

 

For example, if you render barcode on computer screen and the screen resolution is 96dpi.

 

(1) Set NarrowBarWidth property to 0.04,  size_in_pixels = 0.04 * 96 / 2.54 = 1.5118, round up 1.5118 to 2, so actual narrow bar width is 2 pixels.

 

(2) Set NarrowBarWidth property to 0.06,  size_in_pixels = 0.06 * 96 / 2.54 = 2.2677, round down 2.2677 to 2, so actual narrow bar width is 2 pixels.

 

(3) Set NarrowBarWidth property to 0.07,  size_in_pixels = 0.07 * 96 / 2.54 = 2.6456, round up 2.6456 to 3, so actual narrow bar width is 3 pixels.

 

Different NarrowBarWidth property values might end up with same narrow bar width in pixels due to performing rounding operations.