Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 83469

How to convert an image taken from camera to base64 in native app (nanoflow)?

$
0
0
Hi, In a Mx native app we take a picture and want to convert it to a base64 value to use it in an Api call in a Javascript code. 1 – What is the simplest way to achieve this at the moment (i read that it will be possible in february to call from offline app also microflows)? 2 – Should we develop a custom widget for it or can we just write a javascript code for it? 3 – I was also wondering whether I could do the conversion serverside, but since calling a microflow is not supported yet directly, but possible via workaround, I am wondering how to achieve this by passing an image object to it to receive its results back...found this snippet at the forum but without passing an object;   // BEGIN USER CODE return new Promise(function (resolve, reject) { mx.ui.action(microflowName,picture, { progress: "modal", callback: function(result){ resolve(""); } }); }); // END USER CODE --when trying the abouve the mx ui action was not recognized as an function...so I think then to import extra modules or so for mx ui api? 4 – or should i convert binary to base64, since the binary data is available in the object itself? 5 – or can we get the location/url of the image in the localstorage to use in the base64 javascript code?

Viewing all articles
Browse latest Browse all 83469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>