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

Image field utilization

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

    Image field utilization

    Happy Friday all,

    I'm attempting to implement some images into our database which will help the user better identify items. I read that its best to separate Character fields from Image fields so I have created 2 tables and linked them through a set based on a PartID field. I have a Parts table (part ID, description, manufacturer etc) and an Images table (part ID, image1, image2). I thought to setup the image fields to Jpeg image rather than Image Reference for the sake of not losing links. The images will be small as not to take up too much time loading. Hopefully I'm on the right track with this so far, if not, please comment.

    The next step is to setup a method for the user to easily capture images of these products and link them to the existing records of the Parts Table (parent table). Is there a built-in method to capture images? So far I only see "Import Image" which implies that I'll have to open another program to take the picture, name it something, save it to disk, import the record, and finally delete the original file once its imported...I'd like to press a button on the form to capture and import into the db all at once without depending on third part software or creating extra files.

    Surely there is a simple way to capture and add images to the table. I will greatly appreciate any suggestions or ideas.
    Thanks!

    #2
    Re: Image field utilization

    See the documentation for Placing Bitmap and JPEG Image Fields

    There's script snippet near the end.
    There can be only one.

    Comment


      #3
      Re: Image field utilization

      I see the snipit but don't understand it's purpose...
      All it does is creates a new record after selecting a file to import.

      Is there a plug-in that allows me to capture the image using a webcam and automatically fill it into the record?
      Attached Files

      Comment


        #4
        Re: Image field utilization

        If you can name the image and place it in the proper folder? as: 123.jpg which would match the record number in the table, then as a new record is entered in that table it creates the path to the image. it would automatically be connected.

        Depending on your database type, you probably do NOT want the images imbedded into the table.

        You may also want to look at an image software that can resize the images for space purposes.


        My daughter just sent images that were over 1 megabyte each. That is not easily handled and since they are going on a web site, I had to resize to thumbs and display size.
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #5
          Re: Image field utilization

          We capture employee and client photos and signatures using twain image capture devices (Kodak USB camera and TOPAZ signature pads). Those images are stored in a separate folder identified by employee number or client number. In our system, on a fetch record event on the form that displays the images, we point the bitmap object to the image file (all jpg's) and it displays properly. If you only want the image displayed on a button click, you could display it in a dialog box.


          Tom

          Comment


            #6
            Re: Image field utilization

            We scan the little images in Irfanview, Copy, and in A5 rightclick, Paste from clipboard. Larger images are kept as separate files.

            Comment


              #7
              Re: Image field utilization

              it looks like I will have to look outside of alpha since there is no on-step solution. While we are on the topic of images, I have different question regarding a general bitmap image loaded into my code library that I would like to display as a popup (xdialog window?) when the user presses a button on a form. Could someone help by sharing how to code this? What's best:
              -code an xdialog box action onpush button in the form, or
              -write the code in the library and save it as a script and then run the script when the button is pressed,
              is there a difference here?
              Last edited by hov333; 06-24-2013, 12:33 PM.

              Comment


                #8
                Re: Image field utilization

                Key here is where do you save an image in a table?? I think that goes into a memo type field that is done at 2 gig which is not much when images are used. It is better to use an image reference field. reference the image to the table field. Many ways to do this. Selwyn or Richard layed this out a year or two ago where it can be done dynamically. It is here in the forum someplace.

                Try Here:
                http://msgboard.alphasoftware.com/al...ighlight=image
                Last edited by DaveM; 06-24-2013, 11:36 AM.
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                  #9
                  Re: Image field utilization

                  USING THE TWAIN DEVICE, i DON'T NEED TO DO ANY CUTTING AND PASTING.


                  Here is the code we use to capture the image, crop it to size, then save it to disk using the employee badge number as the image name.

                  Code:
                  dim tble as P
                  tble = table.current()
                  ans1 = ui_get_radio("Do you need a Photo, Signature, or Both","both","Photo","Signature","Both")
                  if ans1 = ""
                  	ui_msg_box(agency+" Personnel System","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:\bcbss\photo"+chr(92)+alltrim(str(tble.badge_no))+".jpg"
                  oldfile =  "g:\bcbss\photo"+chr(92)+alltrim(str(tble.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)
                  '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
                  'go to external photo editor to crop
                  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 
                  
                  'Pause the script for a instant until the user interface has finished repainting.
                  ui_msg_box(Agency +" Photo Capture","Continue?")
                  '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 = "Yes"
                    	topparent:Bitmap1.bitmap.filename = filename
                  	parentform.Refresh_Layout()
                  else
                  	ui_msg_box(Agency+" Photo Capture","Action Cancelled at User Request")
                  	end
                  end if
                  'topparent:Bitmap1.bitmap.filename = filename
                  'parentform.Refresh_Layout()
                  Hope it helps.

                  Tom

                  Comment


                    #10
                    Re: Image field utilization

                    Thanks for this tom, but this is way too advanced for me to comprehend. I first need to look into how to incorporate the twain drivers...I have a plain logitech webcam which I want to use. The key here is I need to be able to open a window to capture an image, and have it automatically saved in an existing images folder in the database folder. The filename should match the work_number of the particular record in order for the image reference to link. Any advice?
                    Last edited by hov333; 06-26-2013, 02:43 PM.

                    Comment


                      #11
                      Re: Image field utilization

                      John,

                      What you are asking to do is exactly what I am doing right now. The twain drivers we use are from CIANSOFT. Go to their website and try to figure out loading the drivers and registering them.

                      Don't be discouraged about the code and all that. Without the help of some very impressive minds (Dr. Peter Wayne, and Finian Lennon), I still wouldn't have image capture working. Give it a whirl, and if you run into a couple of speed bumps along the way, just know that there is a whole army of folks more than willing to give you a hand.

                      The end result is you'll look like a hero, and you will be well on your way to serious x-basic coding.

                      Do a search for "twain" in the forum. You will see many posts with examples.

                      Tom
                      Last edited by Tom Henkel; 06-27-2013, 07:53 AM. Reason: more info fo twain devices

                      Comment


                        #12
                        Re: Image field utilization

                        So i'm trying to use the code you shared with the exception of the signature capture.

                        Code:
                        'Date Created: 26-Jun-2013 12:50:48 PM
                        'Last Updated: 26-Jun-2013 01:58:43 PM
                        'Created By  : USER
                        'Updated By  : USER
                        dim tble as P
                        tble = table.current()
                        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 = "C:\TH2013\Images\part_id\\"+alltrim("work_number")+".jpg"
                        
                        
                        if file.exists(oldfile)
                        	file.remove(oldfile)
                        end if
                        if file.exists(filename)
                        	file.rename(filename,oldfile)
                        end if
                        tw.savetofile(filename)
                        
                        'Pause the script for a instant until the user interface has finished repainting.
                        ui_msg_box(Agency +" Photo Capture","Continue?")
                        'display a message box
                        f = file.open(filename,FILE_RO_SHARED)
                        ui_bitmap_load("temp",f.readb(10000000))
                        f.close()
                        
                          	topparent:Bitmap1.bitmap.filename = filename
                        	parentform.Refresh_Layout()
                        
                        end
                        'topparent:Bitmap1.bitmap.filename = filename
                        'parentform.Refresh_Layout()
                        I'm getting an error at line 7. It says could not open OLE object 'TwainControX.Twain'
                        I don't think its registering into Alph. Any help on this?

                        Comment


                          #13
                          Re: Image field utilization

                          Did you download, install and register the CIANSOFT twain drivers?

                          The device name
                          Code:
                          "Kodak DVC325 Digital Video Camera"
                          must match exactly the device you are using. This is not a "drop in the code and go" project. You need to do the prep work and understand the concepts first.

                          Did you read any of the posts for "Twain" first? Search for Perer Wayne's article on twain devices and read it. It helped tremendously.

                          Tom

                          Comment


                            #14
                            Re: Image field utilization

                            This is Dr. Wayne's article on using ActiveX to control a scanner: http://www.learn alpha.com/ActiveXControls.pdf

                            Comment


                              #15
                              Re: Image field utilization

                              Jacob,

                              Thanks for finding that article. I have it on paper, but that doesn't do much on this forum. In the article, Dr. Wayne refers to EZTwain. When I installed EZTwain, I encountered many difficulties with my specific camera.
                              I did find CIANSOFT's TwainX Control, and it worked.

                              Tom

                              Comment

                              Working...
                              X