Hi All,
NT 14.21, C11
I am having the users take a photo of a document (e.g. drivers license) on a black background. Thanks to Charles Edmund and ImageEx, he gave me a routine to remove the background and crop the picture so that I have only the document. It is all code. When the user takes a photo, I want to be able to snag it either before display in the NT webcam picture or I could give them a button to "modify it" and display it in another NT webcam picture. I can save the camera image to disk and manipulate the saved file BUT, I want to grab the image in memory and manipulate it. The take photo and display it appear to be javascript functions in all.js.
I have not played with javascript so I don't have a clue as to how to go about doing this in Javascript in an elegant fashion. Basically, ImageEx can import the photo from a Handle of the Global Memory BLock holding the image or from a URL ( or a file on disk).
So, anyone have any ideas about how to snag this image in memory and send it to Clarion Source code and return it to image in memory for display in the NT webcam field?
The javascript code seems to be:
case 1: //Take Pic
$('#' + id).on('click',function(e){_this.takeSnapshot(e)});
break;
and
// Load canvas
$.fn.getCanvasImage = function(type) {
if (!this[0].toDataURL) {return null;}
if (type === undefined) {
type = 'image/png';
} else {
type = type
.replace(/^([a-z]+)$/gi, 'image/$1')
.replace(/jpg/gi, 'jpeg');
}
return this[0].toDataURL(type);
};
Anyone with good javascript skills who can shed some insight and maybe some code to manipulate the image?
Thanks,
Ron