BarHeight Property

Navigation:  Reference Guide > Properties >

BarHeight Property

Previous pageReturn to chapter overviewNext page

Gets or sets the bar height in centimeters.

[Visual Basic .NET]

Public Property BarHeight As float

[C#]

public float BarHeight {get; set;}

 

Remarks

The default value is 1.5, internally our barcode ASP.NET web control converts bar height 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 BarHeight property to 1.5,  size_in_pixels = 1.5 * 96 / 2.54 = 56.6929, round up 56.6929 to 57, so actual bar height is 57 pixels.

 

(2) Set BarHeight property to 1.52,  size_in_pixels = 1.52 * 96 / 2.54 = 57.4488, round down 57.4488 to 57, so actual bar height is 57 pixels.

 

(3) Set BarHeight property to 1.54,  size_in_pixels = 1.54 * 96 / 2.54 = 58.2047, round down 58.2047 to 58, so actual bar height is 58 pixels.

 

Different BarHeight property values might end up with same bar height in pixels due to performing rounding operations.