Alpha Video Training
Results 1 to 14 of 14

Thread: Capturing Images...

  1. #1
    "Certified" Alphaholic
    Real Name
    Louis Nickerson
    Join Date
    Aug 2002
    Posts
    1,039

    Default Capturing Images...

    Does anyone know if it is possible to capture an image (photo) directly from a digital camera into Alpha5?

    Thank you

    Louis

  2. #2
    Member
    Real Name
    Doug Chanley
    Join Date
    Apr 2000
    Posts
    563

    Default RE: Capturing Images...

    Hi Louis.....

    Yeah, I think I have done that.... as long as the Camera/memory card is assigned a logical drive Alpha5 can find it!

    doug

  3. #3
    "Certified" Alphaholic
    Real Name
    Louis Nickerson
    Join Date
    Aug 2002
    Posts
    1,039

    Default RE: Capturing Images...

    Doug,

    Thanks for the reply.

    Now for the BIG question...

    HOW?

    Thanks again

    Louis

  4. #4
    Thomas Henkel
    Guest

    Default RE: Capturing Images...

    A bigger question is WHY?

    If you are capturing images, wouldn't you want to save them as files, and then display the proper image that goes along with the data? I am not sure that it is good to retain an image within a database. Images are fairly large, and would swell the database fairly rapidly if attached to all of the records in your table.

    We have a system where images are captured and stored as ".bmp" files using a unique identifier as the file name. In alpha, when we want to display the image, we use the identifier within the record and copy the proper bmp file to a specific location on the user's machine, then pop a window up with that image file attached. This makes things very standardized for all of the users. and simple for the form call.

    Tom

  5. #5
    Member
    Real Name
    Doug Chanley
    Join Date
    Apr 2000
    Posts
    563

    Default RE: Capturing Images...

    Louis.....

    I agree with Thomas all the way......
    I was up too late last night, not really hitting on all cylinders yet!!


    I took your original post to mean that you wanted to transfer the "files" to your hard drive, then either use them in an image reference field or display them with in an image object.


    doug

  6. #6
    "Certified" Alphaholic
    Real Name
    Louis Nickerson
    Join Date
    Aug 2002
    Posts
    1,039

    Default RE: Capturing Images...

    Tom,

    Thank you for the reply.

    Perhaps I should explain what I need the end result to be and ask how to accomplish the task.

    My client needs to store a photo of each of his customers. Ideally, there would be a button on the "New Customer" form that would cause the camera to snap a picture. That picture would then be AUTOMATICALLY saved to a file server(actually, an image file server) not within the database itself. The file name would be something like "customer_id.bmp"

    Hope this helps you help me!

    Thanks

    Louis

  7. #7
    Thomas Henkel
    Guest

    Default RE: Capturing Images...

    We need to capture images of our customers as well. We use an "Instant-ID" capture system. It also provides us with the ability to print full color plastic ID cards for our customers and employees. All images are stored on our server. From the "Instant-ID" system, we copy the images to a folder within our customer information folder. There each is named with a unique (case #) id. ie:"C0123456.bmp" In our customer information system, we can click on a "display Image" button which will copy the appropriate image to a file named "image" on the local PC, and then call a form that has an embedded bitmap mapped to the file "image". We needed to do this because bitmaps needed to be identified at form design time.

    If you would like, I can send you the code.

    This method works very well for us. I don't know if it answers your question, though.

  8. #8
    "Certified" Alphaholic
    Real Name
    Louis Nickerson
    Join Date
    Aug 2002
    Posts
    1,039

    Default RE: Capturing Images...

    Thomas,

    Thanks for the reply.

    I was hoping to make the entire capture/name/store process either happen solely within A5 or appear to the end user that this is what is happening.

    I'm tinkering with the idea of having Alpha5 send keystrokes to another program. Now all I need is a image capture program that will work entirely on keystrokes and hopefully in the background.

    I'll let you know if I get to the point of needing your code. Thanks for the offer.

    Louis

  9. #9
    Member
    Real Name
    Doug Chanley
    Join Date
    Apr 2000
    Posts
    563

    Default RE: Capturing Images...

    Louis...


    Not sure what you mean exactly by "capture" but you can definately re-name images from the camera, save them to the hard drive, & display them in a image reference field in an A5 database without the use of external software.

    doug

  10. #10
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default RE: Capturing Images...

    Thomas,

    I would be interested in your code, as I am trying to build an app for an estate agent and they now now take pictures of inside and outside of houses. Thank you in advance.

    Keith Hubert
    London.

  11. #11
    Member
    Real Name
    RMann
    Join Date
    Feb 2006
    Posts
    52

    Default Re: Capturing Images...

    I would also love to see your code.
    please post it or could you send it to me?

    Thanks
    Rob
    Quote Originally Posted by Thomas Henkel View Post
    We need to capture images of our customers as well. We use an "Instant-ID" capture system. It also provides us with the ability to print full color plastic ID cards for our customers and employees. All images are stored on our server. From the "Instant-ID" system, we copy the images to a folder within our customer information folder. There each is named with a unique (case #) id. ie:"C0123456.bmp" In our customer information system, we can click on a "display Image" button which will copy the appropriate image to a file named "image" on the local PC, and then call a form that has an embedded bitmap mapped to the file "image". We needed to do this because bitmaps needed to be identified at form design time.

    If you would like, I can send you the code.

    This method works very well for us. I don't know if it answers your question, though.

  12. #12
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,870

    Default Re: Capturing Images...

    I apologize for not getting back any sooner. Attached is a view of the capture screen. Under the button to capture the photo and signature is the code in this post. We are using a Kodak DVC 325 Digital camera attached to a USB Port. For the Signature we are using a TOPAZ Signature Gem LCD 4x3 signature pad. I did need to install these devices onto my computer, and then use the sketchy instructions that came with them to get them to work. I am NOT using active-x although I should be. I have not yet figured out how to get the code to work properly. If, and when I do, I will post that. Finian Lennon has done some excellent work with the signature pad, and I am checking out his code now.

    What I do is to use OLE to open the camera, then using the PC's imaging product, I shoot the photo, then crop it to size. When the user accepts the image, I save it to a specified jpg name in an image folder. The photo is an OLE image that is displayed on a form.refresh

    The signature code is processed in much the same way.

    Code:
    'Date Created: 24-Aug-2007 02:06:12 PM
    'Last Updated: 22-Jan-2008 10:11:26 AM
    'Created By  : Thomas Henkel
    'Updated By  : 
    dim tbl as P
    tbl = Table.current()
    if tbl.mode_get()>0
    	sys_send_keys("{F9}")
    end if
    ans1 = ui_get_radio("Do you need a Photo, Signature, or Both","both","Photo","Signature","Both")
    if ans1 = ""
    	ui_msg_box(agency+" Customer Infomation","Action Cancelled at User Request")
    	end 
    end if 
    if ans1 = "signature"
    	goto getsig
    end if
    tw = ole.create("TwainControlX.Twain")
    
    for i = 0 to tw.devicecount
    	if tw.devicename(i) = "Kodak DVC325 Digital Video Camera"
    		tw.currentdevice = i
    	end if
    next i
    photostart:
    a5.Minimize()
    
    tw.acquire()
    
    a5.Maximize()	
    
    filename = "g:\images"+chr(92)+ut(image->image)+".jpg"
    oldfile =  "g:\images"+chr(92)+ut(image->image)+"o.jpg"
    if file.exists(oldfile)
    	file.remove(oldfile)
    end if
    if file.exists(filename)
    	file.rename(filename,oldfile)
    end if
    tw.savetofile(filename)
    'now resynch to the new file
    if .not.file.exists(filename)
    	'user hit "cancel" in photo prog
    	ui_msg_box(Agency +" Photo Capture","Action Cancelled at User Request")
    	file.rename(oldfile,filename)
    	goto getsig
    end if
    
    if file.exists(filename) then 
    	sys_open(filename)
    else
    	ui_msg_box("Error Opening File","File "+ filename +" does not exist.",ui_stop_symbol)
    end if 
    
    
    'display a message box
    f = file.open(filename,FILE_RO_SHARED)
    ui_bitmap_load("temp",f.readb(10000000))
    f.close()
    DIM SHARED varC_result1 as C
    heading_string = "Is the Picture OK?"
    yes_button_label = "&Yes"
    no_button_label = "&No"
    cancel_button_label = "&Cancel"
    varC_result1 = ui_dlg_box("Photo Confirmation",<<%dlg%
    	{region}
    	{text=30,1:heading_string};
    	{endregion};
    	{region}
    	{image=temp}
    	{endregion};
    	{line=1,0};
    	{region}
    	<*15=yes_button_label!Yes> <*15=no_button_label!No> <15=cancel_button_label!Cancel>
    	{endregion};
    	%dlg%)
    if varC_Result1 = "No"
    	ui_msg_box(Agency+" Photo Capture","Please Try Again")
    	file.remove(filename)
    	file.rename(oldfile,filename)
    	goto photostart
      elseif varC_Result1 = "Cancel"
    	ui_msg_box(Agency+" Photo Capture","Action Cancelled at User Request")
    	end
      else
      	topparent:Bitmap1.bitmap.filename = filename
    	parentform.Refresh_Layout()
    	
    end if
    
    'topparent:Bitmap1.bitmap.filename = filename
    'parentform.Refresh_Layout()
    
    getsig:
    if ans1 = "Photo"
    	end 
    end if
    dim sigplus1 as P
    sigplus1 = ole.Create("SIGPLUS.SigPlusCtrl.1")
    restart:
    	sigplus1.initsigplus()
    	sigplus1.tabletInvisible = .T.
    	SigPlus1.ClearTablet()
    	SigPlus1.EncryptionMode = 0
                 SigPlus1.SigCompressionMode = 0
                 SigPlus1.TabletState = 0
                 SigPlus1.JustifyMode = 5
                 SigPlus1.JustifyX = 10
                 SigPlus1.JustifyY = 10
                 SigPlus1.DisplayPenWidth = 16
    	sigplus1.TabletState = 1
    	sigplus1.lcdrefresh(0,0,0,240,128)
    	sigplus1.lcdcapturemode = 2
    	sigplus1.lcdwritefile(0,2,0,0,240,128,0,"C:\socsvcs\sigblock.bmp")
    ans2 = ui_msg_box(Agency+" Signature Capture","Please Click -OK- When Finished Signing",65)
    if ans2 = 2
    	ui_msg_box(Agency +" Signature Capture","Action Cancelled at User Request")
    	sigplus1.cleartablet()
    	sigplus1.lcdrefresh(0,0,0,240,128)
    	end
    end if
    
    if sigplus1.NumberOfTabletPoints() >0
    	filename1 = "g:\images"+chr(92)+ut(image->image)+"s.jpg"
    	if file.exists(filename1)
    		file.remove(filename1)
    	end if
    	sigplus1.ImageFileFormat=4
    	sigplus1.ImageXsize = 450
    	sigplus1.ImageYsize = 150
    	sigplus1.ImagePenWidth = 16
    	sigplus1.JustifyMode = 5
    	sigplus1.tabletstate = 0
    	sigplus1.WriteImageFile(filename1)
    	sigplus1.cleartablet()
    	sigplus1.lcdrefresh(0,0,0,240,128)
    	'display a message box
    	f = file.open(filename1,FILE_RO_SHARED)
    	ui_bitmap_load("temp",f.readb(10000000))
    	f.close()
    	DIM SHARED varC_result as C
    	heading_string = "Is the Signature OK?"
    	yes_button_label = "&Yes"
    	no_button_label = "&No"
    	cancel_button_label = "&Cancel"
    	varC_result = ui_dlg_box("Signature Confirmation",<<%dlg%
    		{region}
    		{text=30,1:heading_string};
    		{endregion};
    		{region}
    		{image=temp}
    		{endregion};
    		{line=1,0};
    		{region}
    		<*15=yes_button_label!Yes> <*15=no_button_label!No> <15=cancel_button_label!Cancel>
    		{endregion};
    		%dlg%)
    	if varC_Result = "No"
    		ui_msg_box(Agency+" Signature Capture","Please Try Again")
    		sigplus1.cleartablet()
    		sigplus1.lcdrefresh(0,0,0,240,128)
    		goto restart
    	  elseif varC_Result = "Cancel"
    		ui_msg_box(Agency+" Signature Capture","Action Cancelled at User Request")
    		end
    	  else
    	  	topparent:Bitmap2.bitmap.filename = filename1
    		parentform.Refresh_Layout()
    		end 
    	end if
    	
      else
      	ui_msg_box(Agency+" Signature Capture","No Signature - Please Try Again")
    	sigplus1.cleartablet()
    	sigplus1.lcdrefresh(0,0,0,240,128)
    	goto restart
    end if
    end
    Last edited by Tom Henkel; 04-16-2008 at 01:26 PM. Reason: terrible typing

  13. #13
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Capturing Images...

    Hi Tom,
    Thanks for this---kinda cool that someone can ask about something 5+ years down the way and still be able to get an answer!
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  14. #14
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,870

    Default Re: Capturing Images...

    As a follow-up to my prior post,

    We need to capture images of our customers as well. We use an "Instant-ID" capture system. It also provides us with the ability to print full color plastic ID cards for our customers and employees. All images are stored on our server. From the "Instant-ID" system, we copy the images to a folder within our customer information folder. There each is named with a unique (case #) id. ie:"C0123456.bmp" In our customer information system, we can click on a "display Image" button which will copy the appropriate image to a file named "image" on the local PC, and then call a form that has an embedded bitmap mapped to the file "image". We needed to do this because bitmaps needed to be identified at form design time.
    We no longer use the "image" named file. With the x-basic code in the example, the bitmap is pointed directly at the file name in question.

    Because of problems with our original Photo-ID system (Company disbanded), we needed to provide a complete solution in alpha. Using ver 8, we have the photo and signature capture working very well for both client information and employee badge information.

    Tom

Similar Threads

  1. Capturing and posting help
    By Art Cordaro in forum Alpha Five Version 4
    Replies: 3
    Last Post: 03-31-2005, 07:05 AM
  2. Capturing external events
    By Walter Campbell in forum Alpha Five Version 5
    Replies: 5
    Last Post: 05-24-2003, 01:56 PM
  3. Capturing MSWord Documents
    By Gary Bangoy in forum Alpha Five Version 5
    Replies: 0
    Last Post: 04-24-2003, 02:09 PM
  4. Capturing Field Value of Most Recent Record
    By Howard G. Cornett in forum Alpha Five Version 5
    Replies: 2
    Last Post: 04-22-2003, 12:56 AM
  5. Capturing, storing and using variables
    By davej in forum Alpha Five Version 4
    Replies: 1
    Last Post: 04-25-2000, 11:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •