NumberDigitImage

Creates list of images to represents a number.
Basically multiple < img > tags (or < i >) next to each other to show a number
Can use JPPGs, PNGs or FontAwesome number icons
Used a special version here in this website

CodeFunctionName
What is this?

Public

Tested

Original Work
Function NumberDigitImage(ShowNumber, ImageHTMLTagTemplate, NoOfDigits)
    ' Creates List of Images to show number in large
    '    With ability to have leading zeros or blanks
    '    You need to have 11 images, 1 image per digit 0-9 with an image to represent the blank digit used _ as digit as below
    '    Please see attached zip for 7 full sets included
    '    Can also use FontAwesome icons, again examples below
    '
    ' ShowNumber is the number to be displayed
    ' NoOfDigits is the full length of digits to be shown, can be larger than length of ShowNumber to have additional spaces before number
    ' ImageTHMLTagTemplate is the full image tag in HTML. Possible list of images are described below in variable "ImageHTMLTagTemplate"s below
    '

    ImageHTMLTagTemplate    = ""
    ImageHTMLTagTemplate    = " <i class=""fa-solid text-primary fa-{{$Digit$}} fa-4x"" > </i >"
    ImageHTMLTagTemplate    = " <i class=""fa-sharp fa-solid text-light fa-square-{{$Digit$}} fa-4x"" > </i >"
    ImageHTMLTagTemplate    = " <i class=""fa-sharp fa-solid text-primary bg-light fa-square-{{$Digit$}} fa-4x"" > </i >"
    ImageHTMLTagTemplate    = " <img src=""/assets/img/board-{{$Digit$}}-1280.jpg"" width=""50"" / >"
    ImageHTMLTagTemplate    = " <img src=""/assets/img/Numdigi RR{{$Digit$}}.png"" width=""50"" / >"
    ImageHTMLTagTemplate    = " <img src=""/assets/img/number-{{$Digit$}}-640.png"" width=""50"" / >"
    ImageHTMLTagTemplate    = " <img src=""/assets/img/digital-{{$Digit$}}-640.png"" width=""50"" / >"
    ImageHTMLTagTemplate    = " <img src=""/assets/img/Numdigi GG{{$Digit$}}.png"" width=""50"" / >"
    ImageHTMLTagTemplate    = " <img src=""/assets/ing/Numdig G{{$Digit$}}.jpg"" width=""50"" / >"
    ImageHTMLTagTemplate    = " <img src=""/assets/img/Numdig R{{$Digit$}}.jpg"" width=""50"" / >"
    Rett                        = ""
    If Len(ShowNumber) > NoOfDigits Then
        CodesDigi            = ShowNumber
    Else
        CodesDigi        = Right("______" & ShowNumber , NoOfDigits ) ' Accepts only 4 digits for now
        If Left(ImageHTMLTagTemplate, 4) = " <i c" Then CodesDigi = Right("000000000" & ShowNumber , NoOfDigits )
    End If
    For I = 1 To Len(CodesDigi)
        Rett                    = Rett & Replace(ImageHTMLTagTemplate, "{{$Digit$}}", Mid(CodesDigi, I, 1))
    Next
    Rett                        = Rett & ""
    NumberDigitImage        = Rett
End Function

ShowNumber, ImageHTMLTagTemplate, NoOfDigits

Views 148

Downloads 57

CodeID
DB ID