How to control a camera using Delphi

Delphi must take photos with photos using the Nikon D5000AF SDX. The only commands I need are "take a photo", "Bring me a photo."

Which library or API can help me?

+3
source share
3 answers

@Heinz, you must use the SDK provided by the device manufacturer to control the device.

from nikon website:

.... We offer library programs and API specifications for API software applications that offer remote control functions for Nikon DSLR cameras connected to a computer. When used, a software application can be used to change camera settings, including shutter speed, aperture and ISO sensitivity, and camera control operations, including shutter release.

on this page you can find the SDK for Nikon cameras, including the D5000 series.

Bye

+11
source

I would recommend using the WIA (Windows Image Acquisition) API. To do this, you need the file "WIALib_TLB.pas", which will be automatically created by Delphi in the following steps:

  • Choose Project> Import Type Library from the menu.
  • Select "Microsoft Windows Image Acquisition 1.01 Type Library" from the list
  • Select Create Block
  • Then you will get the block "WIALib_TLB.pas"

Use the code from the following URL to find out how you can list the available devices and their properties and take a picture with the camera.

http://www.neunbeere.de/UseNet/WIA.html

Sorry, the comments are in German, but I think the code is easy to understand

+8
source
  • you can use wia (image acquisition in windows)
  • from the components menu, select the import component and select an image in the acquisition and installation window
  • or upload and add to your project
  • then
  • If you use win xp
  • start a new project and put
  • new button named Button1
  • new CheckBox named MultiPic
  • and copy the cod and past into Button1

cod:

procedure TForm1.Button1Click(Sender: TObject); var wia:IWia; WiaInf: IWiaDeviceInfo; wiaImg: IWiaDispatchItem; I:integer; Coll: ICollection; begin wia:=CoWia.Create; WiaInf:= WIA.Devices.Item[0] as IWiaDeviceInfo; wiaImg:=WiaInf.Create; if MultiPic.Checked then begin coll:=wiaImg.GetItemsFromUI(UseCommonUI, MaximizeQuality); for I := 0 to coll.Count - 1 do begin wiaImg:=coll.Item[i] as IWiaDispatchItem ; wiaImg.Transfer('C:\Source\test'+inttostr(i)+'.bmp',false); end; end else begin wiaImg:=wiaImg.GetItemsFromUI(SingleImage, MaximizeQuality).Item[0] as IWiaDispatchItem ; wiaImg.Transfer('C:\Source\test.bmp',false); end; end; 
  • I am using CheckBox for the user. Determine if he wants 1 image or several photos

  • you can upload image / image to loadfromfile

+1
source

Source: https://habr.com/ru/post/1410994/


All Articles