Does anyone know if it is possible to capture an image (photo) directly from a digital camera into Alpha5?
Thank you
Louis
Thank you
Louis
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
'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
Comment