BookmarkSubscribeRSS Feed
🔒 This topic is locked. We are no longer accepting replies to this topic. Need further help? Please sign in and ask a new question.
SAS_Tipster
Moderator

A little-known HTML trick is that you can embed images in an HTML file using a Base 64 representation of an image. For example, a folder open image can be generated using the following text in an HTML page:


<img src="data:image/png;base64,R0lGODlhEAAQAKL/AP//////AMDAwMDAwICAgICAAAAAAAAAACH5BAEAAAIALAAAAAAQABAAAANFKEpMpjAKAkYYTkJqu2sbII6kSCzApXbqM1VrPLiUWpYGFwBF7/+51ID3KwaHReNrlwS+iM0CTRTtTavSjWHL7W41YE0CADs=" border="0" width="4">

 

which will display as: OpenFolder.PNG

 

The width parameter can be used to size the image as desired. Note that the image becomes fuzzy if you use a width that is wider than the original image that you encoded.

 

There are a number of web-sites that will convert images to the Base 64 representation. This Google search provides a sampling.

 

To see the above img tag as an actual image and for a discussion of a parameter/macro driven approach see my blog post The getImage macro: embedded images using text strings

 


Thanks to Don Henderson for sharing this tip on sasCommunity.org.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Visit a random SAS tip This SAS Tips board is not open for replies or comments, but we welcome your feedback and questions. Have a question or comment about this tip? Start a new topic in one of our discussion boards, and reference this tip topic.
Discussion stats
  • 0 replies
  • 1329 views
  • 1 like
  • 1 in conversation