Thursday, June 23, 2016

Converting a bitmap (.bmp) to data URI using Java

If you want to show a bitmap (encoded in base64) in <img src>, and you are using Java Convert class to do the conversion to base64, make sure you use Base64.NO_WRAP instead of Base64.DEFAULT as the second parameter (otherwise, you'll get blank or  broken img in img tag).

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...