billyChou Posted November 28, 2013 Share Posted November 28, 2013 Hi All! Does anyone know, how to Capturing camera save picture data in andriod or iphone? Thanks Quote Link to comment Share on other sites More sharing options...
Harry Rogers Posted November 29, 2013 Share Posted November 29, 2013 AFAIK there is no browser based access to the camera on these devices unless you use a wrapper such as phonegap that does then provide a JS route. Another alternative might be to use a web cam app on the device and then access the images via its webpages ? Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted November 29, 2013 Share Posted November 29, 2013 You can use this in an UniHtmlFrame: <div id="viddiv" style="display:block; width:100%; height:100%"> <video id="livevideo" width="100%" height="100%" autoplay></video> </div> <div id="picdiv" style="display:none;"> <div id="picdivbuttons" style="width:100%"> <button onclick="upload();">Upload</button> <button onclick="tryagain();">Try again</button> <button onclick="closeapp();">Close</button> </div> <div id="picdivcanvas" style="width:100%;"> <canvas id="takenpic"></canvas> <div id="picdivbuttons"> </div> <script type="text/javascript"> var video = document.getElementById("livevideo"); var canvas = document.getElementById("takenpic"); var context = canvas.getContext("2d"); navigator.getMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia ); navigator.getMedia( {video: true}, function(stream) { video.src = window.URL.createObjectURL(stream); }, function(err) { alert("No camera access!"); } ); video.addEventListener('click', takepic, false); function takepic() { document.getElementById("picdiv").style.display = "block"; canvas.width = document.getElementById("viddiv").offsetWidth; canvas.height = document.getElementById("viddiv").offsetHeight; context.drawImage(video, 0, 0); document.getElementById("viddiv").style.display = "none"; } function upload() { alert('Upload the canvas here...'); } function tryagain() { document.getElementById("picdiv").style.display = "none"; document.getElementById("viddiv").style.display = "block"; } function closeapp() { ajaxRequest(frmMain.hfrWebCamPic, "closeapp", []); } </script> After that you have a picture on a Canvas. To upload the canvas (picture) see here: http://forums.unigui.com/index.php?/topic/2019-loading-unicanvas-and-native-canvas-to-db/ Tested with FF and Chrome on Windows and Chrome on Android. Quote Link to comment Share on other sites More sharing options...
billyChou Posted November 30, 2013 Author Share Posted November 30, 2013 Thanks Quote Link to comment Share on other sites More sharing options...
mehmet07 Posted July 11, 2014 Share Posted July 11, 2014 Hi, i use this sample camera code. but i can not save cam photo. how i can on canvas picture save? thanks Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted July 12, 2014 Share Posted July 12, 2014 Hi, i use this sample camera code. but i can not save cam photo. how i can on canvas picture save? thanks See here: WebCamPic.zip Quote Link to comment Share on other sites More sharing options...
mehmet07 Posted July 12, 2014 Share Posted July 12, 2014 thanks Oliver. i will try . Quote Link to comment Share on other sites More sharing options...
xiaolong Posted November 21, 2018 Share Posted November 21, 2018 On 2014/7/12 at PM4点07分, Oliver Morsch said: 看这里: WebCamPic.zip Can you reattach it? Quote Link to comment Share on other sites More sharing options...
xiaolong Posted November 21, 2018 Share Posted November 21, 2018 你可以重新连接吗? Quote Link to comment Share on other sites More sharing options...
adragan Posted December 7, 2018 Share Posted December 7, 2018 It's so simple : Use TUnimUpload UnimUpload.Accept:='image'; UnimUpload.Capture:='camcorder'; //For some reason 'camera' did not work UnimUpload.Execute; and OnCompleted CopyFile(PChar(AStream.FileName), PChar(DestName), False); where DestName is where on the server you want the picture saved. That's all Quote Link to comment Share on other sites More sharing options...
Felipe Lugo Posted August 24, 2019 Share Posted August 24, 2019 Sorry, exist this TUnimUpload component? The TUnimFileUpload is the same? because i can capture any image from the camera. Thank's Quote Link to comment Share on other sites More sharing options...
andyhill Posted August 24, 2019 Share Posted August 24, 2019 Felipe, Mobile (I will assume iOS/Safari in this case) requires a https Digital Certificate off memory. Quote Link to comment Share on other sites More sharing options...
Bahadır Posted September 10, 2022 Share Posted September 10, 2022 Same problem... How the image captured from the video is forwarded to the stream. With Delphi please... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 10, 2022 Share Posted September 10, 2022 9 minutes ago, Bahadır said: Same problem... How the image captured from the video is forwarded to the stream. With Delphi please... Hello, Please describe in full what you want to achieve. Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted September 10, 2022 Share Posted September 10, 2022 40 minutes ago, Bahadır said: Same problem... How the image captured from the video is forwarded to the stream. With Delphi please... Download component free, with full source code: https://store.falconsistemas.com.br/ Quote Link to comment Share on other sites More sharing options...
Bahadır Posted September 10, 2022 Share Posted September 10, 2022 2 hours ago, Marlon Nardi said: Download component free, with full source code: https://store.falconsistemas.com.br/ Thank you. I tried it, I got very good results. Can I do this on a tablet like iPad? Quote Link to comment Share on other sites More sharing options...
Bahadır Posted September 10, 2022 Share Posted September 10, 2022 When I click the Take Photo button, I want to capture the camera image appearing in the frame and transfer it to a TMemoryStream (for example, a visiting card). I want to do this on tablet (Ipad) and desktop. Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted September 10, 2022 Share Posted September 10, 2022 38 minutes ago, Bahadır said: Thank you. I tried it, I got very good results. Can I do this on a tablet like iPad? open this example project to validate that it works on your iPad. https://demos.falconsistemas.com.br/?tela=tfrmcamera Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.