Example #1
0
 def get_mm(self):
     return dpi2px(1, 'mm')
Example #2
0
 def get_pt(self):
     return dpi2px(1, 'pt')
Example #3
0
 def get_cm(self):
     return dpi2px(1, 'cm')
Example #4
0
 def get_dp(self):
     return dpi2px(1, 'dp')
Example #5
0
 def get_sp(self):
     return dpi2px(1, 'sp')
Example #6
0
def sp(value) -> float:
    '''Convert from scale-independent pixels to pixels
    '''
    return dpi2px(value, 'sp')
Example #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')
Example #8
0
def dp(value) -> float:
    '''Convert from density-independent pixels to pixels
    '''
    return dpi2px(value, 'dp')
Example #9
0
def mm(value) -> float:
    '''Convert from millimeters to pixels
    '''
    return dpi2px(value, 'mm')
Example #10
0
def cm(value) -> float:
    '''Convert from centimeters to pixels
    '''
    return dpi2px(value, 'cm')
Example #11
0
def inch(value) -> float:
    '''Convert from inches to pixels
    '''
    return dpi2px(value, 'in')
Example #12
0
def pt(value) -> float:
    '''Convert from points to pixels
    '''
    return dpi2px(value, 'pt')