I am using the phonegap barcodescanner plugin from https://github.com/wildabeast/BarcodeScanner
I am encoding a text string and would like to display only the generated image. Right now I'm using the following code
window.plugins.barcodeScanner.encode(
"TEXT_TYPE",
strToEncode,
function(success) {
console.log("Encoding succeeded");
alert("Encode success: " + success);
},
function(fail) {
console.log("Encoding failed");
alert("Encode failed: " + fail);
}
);
The success object in the alert returns a image with the encoded text below it. I would like to instead get and show only an image object from the result. Is there such a function like success.toBitmap or something like that? Or is there an alternative way I could do it?
N.B. I'm actually using this in an Oracle MAF application, so if there are some MAF specific answers it would be great too. Code is as below
<amx:verbatim id="v1">
<![CDATA[
<script type="text/javascript" src="js/barcodescanner.js"></script>
<script type="text/javascript">
function generateBarcodeFromJavaBean(strToEncode) {
console.log("Entering generateBarcodeFromJavaBean");
window.plugins.barcodeScanner.encode(
"TEXT_TYPE",
strToEncode,
function(success) {
console.log("Encoding succeeded");
alert("Encode success: " + success);
},
function(fail) {
console.log("Encoding failed");
alert("Encode failed: " + fail);
}
);
}
</script>
]]>
</amx:verbatim>