This will not show an image but you can embed binary data at compile time with 
something like this
    
    
    import os, macros, base64
    
    macro embed_binary_file(var_name:untyped,filename:string) : typed =
      let bin64 = base64.encode(slurp(filename.strVal))
      result = newStmtList()
      result.add(newLetStmt(var_name,newStrLitNode(bin64)))
    
    embed_binary_file(img,"digits.bmp")
    echo("Image Data:" & $img)
    

Reply via email to