Ejemplo n.º 1
0
 def get_mm(self):
     return dpi2px(1, 'mm')
Ejemplo n.º 2
0
 def get_pt(self):
     return dpi2px(1, 'pt')
Ejemplo n.º 3
0
 def get_cm(self):
     return dpi2px(1, 'cm')
Ejemplo n.º 4
0
 def get_dp(self):
     return dpi2px(1, 'dp')
Ejemplo n.º 5
0
 def get_sp(self):
     return dpi2px(1, 'sp')
Ejemplo n.º 6
0
def sp(value) -> float:
    '''Convert from scale-independent pixels to pixels
    '''
    return dpi2px(value, 'sp')
Ejemplo n.º 7
0
 def get_in(self):
     # we bind to all dpi, density, fontscale, even though not all may be
     # used for a specific suffix, because we don't want to rely on the
     # internal details of dpi2px. But it will be one of the three. But it's
     # an issue, since it won't trigger the prop if the value doesn't change
     return dpi2px(1, 'in')
Ejemplo n.º 8
0
def dp(value) -> float:
    '''Convert from density-independent pixels to pixels
    '''
    return dpi2px(value, 'dp')
Ejemplo n.º 9
0
def mm(value) -> float:
    '''Convert from millimeters to pixels
    '''
    return dpi2px(value, 'mm')
Ejemplo n.º 10
0
def cm(value) -> float:
    '''Convert from centimeters to pixels
    '''
    return dpi2px(value, 'cm')
Ejemplo n.º 11
0
def inch(value) -> float:
    '''Convert from inches to pixels
    '''
    return dpi2px(value, 'in')
Ejemplo n.º 12
0
def pt(value) -> float:
    '''Convert from points to pixels
    '''
    return dpi2px(value, 'pt')