Skip to main content
Version: v6.5.0

Convert image files to Base64

Command Description

Convert image file to Base64 and return Base64 string

Command Prototype

sRet = Picture.FileToBase64(sFile)

Command parameter

parametermandatorytypedefault valueexplain
sFileTruepath''' C:\Users'''The image file that needs to be processed has a file size of no more than 50M and only supports BMP, PNG, GIF, JPEG, TIFF file formats

Return result

SRet, Assign the result of running the command to this variable.

Run instance

/*********************************Image File to Base64*********************************
Command Prototype:
sRet = Picture.FileToBase64(sFile)
Input Parameters:
sFile -- Image path. Note: The image file to be processed. File size should not exceed 50M. Supported file formats: BMP, PNG, GIF, JPEG, TIFF only.
Output Parameter:
sRet -- The variable where the output of the function call will be saved.
Notes:
None
********************************************************************************/
Dim sRet = ""
sRet = Picture.FileToBase64('''C:\Users''')
TracePrint(sRet)