Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

ActiveX for Signature Pad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: ActiveX for Signature Pad

    OK, 1st time I've tried requesting help in this forum. I'm sure you've heard this a 1,000 times, but I am so new to this my born-on-date is nov07.... who knows about expiration date.
    I am using peaces of your code to do the ID card photo thing, and I am testing with a free activex I found in a different post in the forum "ezvidC60.ocx" from shrinkwrapvb.com. I wroe a very basic code to take a single snapshot and save it to a file, but I keep getting an error and I don't know if it is a problem with the activex or my coding. Here is my simple code:

    tw = ole.create("vbVidC60.ezVidCap")

    photostart:

    a5.Minimize()

    tw.SaveSingleFrame("c:\photo.jpg")

    a5.Maximize()


    Shouldn't this save the snapshot to the root of c?
    I get an ole Automation Error, method not found...

    Any help you or any of the other pro's here can provide is greatly appreciated....cause I'm stumped
    DanH
    Last edited by DaBoomer; 11-28-2007, 10:24 PM. Reason: add thanks

    Comment


      #17
      Re: ActiveX for Signature Pad

      Dan,

      I didn't see any "acquire" type of activity. To see what methods and properties are available with the acquire software, in the interactive window, after you do the tw = OLE.CREATE(), do a ?tw. This will display a list of those methods that you can use. There should be some sort of documentation available with the product that you can reference. In my code, "photostart:" is just a label for reference. It has no executable function. I see that you have a "savetofile", but what I don't see is some sort of acquire process(shown below in red).

      Code:
      photostart:
      a5.Minimize()
      
      [B][COLOR="Red"]tw.acquire()[/COLOR][/B]
      a5.Maximize()	
      
      filename = "F:\photo"+chr(92)+alltrim(str(employee->badge_no))+".jpg"
      oldfile =  "F:\photo"+chr(92)+alltrim(str(employee->badge_no))+"o.jpg"
      
      if file.exists(oldfile)
      	file.remove(oldfile)
      end if
      if file.exists(filename)
      	file.rename(filename,oldfile)
      end if
      tw.savetofile(filename)
      Do a little more research into the actual photo acquire with the software you have, and I think you will have better results. The .acquire and .savetofile in my code are specific to the twain software I am using. There may be similar functions in your software, but they may not be exactly the same.

      Tom
      Last edited by Tom Henkel; 11-29-2007, 09:15 AM. Reason: another thought...

      Comment


        #18
        Re: ActiveX for Signature Pad

        Thankyou Tom,
        The reason the Method not Found, was actually because the method was not found!!! Imagine that. I was trying different Twain Activex controls, and what happened was amethod from a different activex was in there, as well as the "No Aquire" problem
        What I found in A5V8, is the interactive window will show the methods from an old ole.create even though I changed it to the new activex.
        I have given up on that activex though, I could not make it work. I found a fair priced one from ciansoft and it works. Now I am trying to figure out your filenaming using the id number. It it exactly what i want to do, but it tells me the field isnt found. I'm using my table and field names not yours and I changed the drive to C. Was there code you had to place elswhere in your form for the filename to includ the id number from the record?
        I will keep hammering on it.
        Thanks for your help!

        DanH

        Comment


          #19
          Re: ActiveX for Signature Pad

          OK, I figured out the Table.Open, but I still get an error and I can't tell why.

          tw = ole.create("twaincontrolxtrial.twain")

          table.open("employee")

          tw.CurrentDevice = "0"

          tw.Acquire()

          filename = "C:\photo"+chr(92)+alltrim(str(employee->EmpRcd_ID))+".jpg"

          tw.SaveToFile(filename)

          ERROR: OLE Automation Error. Source is TwainControlXTrial.Twain."
          Cannot create file C:\photo\1.jpg"

          Any ideas??

          Comment


            #20
            Re: ActiveX for Signature Pad

            Oh Man, my photo folder is PHOTOS
            struggled with that for a long time....
            One little letter took me hour, don't know if I can hack being a database designer!

            Comment


              #21
              Re: ActiveX for Signature Pad

              don't know if I can hack being a database designer!
              But you'll get an incredible sense of satisfaction and accomplishment when you finally get it to work the way you want!

              ba

              Comment


                #22
                Re: ActiveX for Signature Pad

                Dan,

                Guess what? I tried several "free" active x components, and finally settled on Ciansoft. That was the only one I actually got working to my satisfaction. My ID number is either a client's case number (in the record) or an employee's badge number( also in the record.)

                Tom

                Comment


                  #23
                  Re: ActiveX for Signature Pad

                  Tom, since we are using the same control maybe you can tell me. Everytime I click my snapshot button, a secondary window opens with the video feed on the left, and a tiny pic on the right of every single capture I have done before it. Now, when I click the capture button in that screen, it makes a tiny pic of the capture in the right and goes to it automatically, so this is a trivial event, but I would rather just display the snapshot in my form.... long question short, is this capture screen part of the activex or is it from my OS.... I know it isnt the camera because the logitech capture screen is way different. If it is part of the control, were you able to disable it or do you use it?

                  DanH

                  Comment


                    #24
                    Re: ActiveX for Signature Pad

                    Originally posted by DaBoomer View Post
                    Tom, since we are using the same control maybe you can tell me. Everytime I click my snapshot button, a secondary window opens with the video feed on the left, and a tiny pic on the right of every single capture I have done before it. Now, when I click the capture button in that screen, it makes a tiny pic of the capture in the right and goes to it automatically, so this is a trivial event, but I would rather just display the snapshot in my form.... long question short, is this capture screen part of the activex or is it from my OS.... I know it isnt the camera because the logitech capture screen is way different. If it is part of the control, were you able to disable it or do you use it?

                    DanH
                    Dan,

                    It certainly isn't part of the twain software, and I don't think it has anything to do with the Active-x. We use a Kodak DVC 325 camera, and I actually minimize Alpha when I go to the capture. The Kodak software takes over, and gives me a new window for taking the picture. Once I click OK to the picture, Alpha takes control again, where I again relinquish control, this time to a photo editor so that the worker can crop the picture. When that is done, I take back control and update my form with the newly taken and edited picture. Here is the complete bit of code for the capture. I noticed you are using the trial version. There is a restriction in the trial about saving to file.

                    Code:
                    tw = ole.create("TwainControlX.Twain")
                    'this is where we select the appropriate twain device
                    'Our signature pad is also twain enabled, and I need to get the camera now
                    for i = 0 to tw.devicecount
                    	if tw.devicename(i) = "Kodak DVC325 Digital Video Camera"
                    		tw.currentdevice = i
                    	end if
                    next i
                    photostart:
                    'clear alpha from the screen
                    a5.Minimize()
                    
                    tw.acquire()
                    
                    'bring it back
                    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 
                    'this is where I open the default photo editor to allow for cropping
                    	sys_open(filename)
                    else
                    	ui_msg_box("Error Opening File","File "+ filename +" does not exist.",ui_stop_symbol)
                    end if 
                    
                    'back in alpha,  display the photo that was just taken for approval or retry
                    '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
                    My guess with your situation is that whatever software is actually controlling the camera, not the twain interface, or Alpha, is keeping sone sort of link to the folder where you keep your photos, and displays thumbnails of all previous photos. In my case, that would be insane as I have about 22000 client photos in the folder.

                    Tom
                    Last edited by Tom Henkel; 12-04-2007, 06:43 PM. Reason: Added ALL the Photo capture code...

                    Comment


                      #25
                      Re: ActiveX for Signature Pad

                      Thanks for all your help Tom... care to take a stab at what I think is my final problem?

                      This is real basic code just to make it work, so i havent done commenting or error dialogues.

                      I placed the (PICFILE) variable in the init section of the form it simply reads

                      table.open("Employee")
                      dim global picfile as c
                      picfile = "C:\photos"+chr(92)+alltrim(str(employee->Emp_fname))+"_"+alltrim(str(employee->Emp_lname))+".jpg"


                      This is my OnPush button
                      tw = ole.create("twaincontrolx.twain")
                      tw.CurrentDevice = "0"
                      tw.Acquire()
                      tw.SaveToFile(picfile)

                      if file.exists(picfile)
                      tbl = table.current()
                      tbl.change_begin()
                      tbl.Emp_Photo = image_filename_encode(picfile)
                      tbl.change_end(.t.)
                      end if

                      parentform.Refresh_Layout()

                      My problem is, this works great for existing records, but when I do a new record, i get an error about the tbl.change_begin already began.

                      If I remove that, then new records work fine, but existing records dont work because change_begin hasnt begun.

                      I have tried so many different things i've confused myself. i tried an
                      if tbl.mode_get() = 1 then
                      tbl.change_end
                      but this doesnt work

                      any ideas???


                      DanH

                      Comment


                        #26
                        Re: ActiveX for Signature Pad

                        You said, "When I enter a New Record". This is indicating that the table is open for enter. You need to check that the table is in "edit mode"


                        wrap this around your "Change Begin" and "Change End" statements, NOT the code between.

                        Code:
                        If Tbl.mode_get() =0
                                           Change_begin()
                                  End if
                        
                        ...  Your Code Here
                        
                        
                        If Tbl.mode_get() =2
                                           Change_end()
                                  End if
                        This should aleviate your "already in change mode issue"
                        Last edited by Tom Henkel; 12-16-2007, 03:24 PM. Reason: Still can't type

                        Comment

                        Working...
                        X