We would like to integrate the device camera into an application written in Delphi. The device is a Dell Windows 8 tablet. What we need is quite simple. A button would launch the camera, passing a file name for the stored image. Once the picture is taken, and stored in the specified file name, control would pass back to our application. Having control go back to the Delphi app is not as important; we could write a loop to look for it and have it come to front once it is found.
What would be the simplest way to accomplish this?
Can the camera be called passing a filename parameter?
Windows comes with WIA, Window Image Acquisition which can be used for this.
Here are some Delphi specific links:
Delphi: WIA to take image from digital Camera connected to USB
How to control a camera with Delphi
http://www.neunbeere.de/UseNet/WIA.html
Related
I've been investigating various method of exporting video from my FMX application, in particular mp4 using the h.264 codec. One method is to use FFmpeg with the FFVCL components. The down side of this is that including FFmpeg dlls with my application increases the download size. The other problem is the licensing issue of using the libx264 encoder. There is a free to use libopenh264 encoder but isn't as good as it only supports the Baseline profile.
However, Windows has video encoding built in which includes the full h.264 with High profile (mfh264enc.dll). This seems like the ideal solution for high quality video export while minimising the size of my application and avoiding licensing problems. The following page gives information on the video encoding interface in Windows.
https://learn.microsoft.com/en-us/windows/win32/medfound/overview-of-encoding-in-media-foundation
My question is how can I call this from Delphi to export video from a sequence of images stored in TBitmap? My application is FMX but initially only for Windows. Has anyone already created a Delphi interface for video encoding using the built in Windows dlls? I don't have much experience with calling dlls from Delphi. How much work would it be to create an interface myself?
Like I wrote in the title, I want to take pictures from a Windows tablet, but do not found how do it.
Firemonkey is supposed to allow the multi-platform development, but everything I found to take pictures is working only on Android and iOS.
The sample given by Embarcadero here does not works on Windows, it appears that Windows do not recognize the event TakePhotoFromCameraAction1 because any button with this action does not appears on the form.
I also tried this one, and 2 others called CameraComponent and WebcamExample, I do not remember where I found them, but nothing works.
I thought to try to access directly to the Windows' Camera application, like as the first answer here for the touch keyboard, but I do not found the .exe.
I am using Delphi XE8, and the target platform is Win32. Can someone help me on it ?
The device is the Fieldbook K80 : logic-instrument.com/en/fieldbook-k80.php
I found a way to use the Windows Camera, perhaps someone else may be interested. I execute a Windows command to launch the camera app thanks to the library Winapi.ShellAPI :
ShellExecute(0, 'OPEN', PChar('microsoft.windows.camera:'), '', '', 1);
Thanks to this post in C# : Run Camera App of Windows 10 from Desktop Application
I am using RAD Studio xe6 and I have a simple Firemonkey form, what I want to do is get all Images that are in a folder and display them in a list for the user to see, is this possible, and if yes how.
Delphi already ships with a sample program which does similar thing that you seek. The sample program is called FireFlow. If you haven't installed sample programs while installing Delphi you can get the sample program from:
http://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.FireFlow_Sample
But othervise what you want to do is first search the specific directory for supported image files. To do this use FindFirst, FindNext.
Then you need to decide how are you going to display these images. Now if you intend to display them inside the listbox controll do check the CustomListBox sample which you can also get from web here:
http://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.CustomListBox_Sample
With Windows 7/8, this very nice ole2 interface IWebBrowserDisp is no more working properly, for some reason it now opens the IExplorer Window behind the actual currently running delphi application, not to the front of the screen as it used to be work earlier.
This makes the application to fail as user cannot see the opening web page without manually switching to Iexplorer and locating the correct window.
The code that I use to launch the link is:
WB : TEmbeddedWB;
wb.Navigate(URL,x,x,x,x);
This problem does not exist in older Windows or while I use my Delphi IDE ( I use Delphi4 and run it as ADMIN).
I have tried many webcam components for delphi XE (Tcamera, TJVAviCapture, sources codes I found...) Mostly of them work on my desktop computers, but does not work on my maptop (tested with 2 laptops).
They open this source video window, and then webcam panel.
Some of them work in DELPHI IDE but not in .exe generated by delphi !
Does someone know a reliable component (or a snippet) that simply display the webcam on any laptop or dektop without showing that video source window ?
Regards
I've been using the Mitov Video Library for several years to do this sort of thing and am very happy with it. It's run my webcam application on many hundreds laptops and desktops all over the world without any problems. Free for non-commercial use. Regularly updated. Good support. Source code available.
http://www.mitov.com/screenshots/videolab