Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Image based Data entry using image coordinates

Image based Data entry using image coordinates

Image based Data entry using image coordinates

Hi all

I have an assignment to develop an image based data entry system. The image control requirements are that system should show relevant snippets of the image when user is entering relevant field. e.g. when I am entering a name, the name data should be highlighted on the image. The logic for this is to map coordinates on the image and use those coordinates. The image is a PDF file which should show pages also as per various parts of the data entry screen. I have done a lot of research on this but am unable to work out a proper solution. How do we use coordinates to make the image display the particular snippet? Can someone point me to any resources or any guidance on this? Any help would be much appreciated as then I can take up other assignments of similar nature (for the same client) which need to be developed. Also, what would be an ideal image control to use for this?

Thanks in advance
Ravi Bangera

RE: Image based Data entry using image coordinates

Let me get this right.

You are displaying an existing image. The user enters some text, which in some way links to a portion of the image. You then want to highlight that portion of the image in some way. Is that correct?

So, the image might show a street with cars, lorries and a bus. The user types something that represent a bus. You then want to highlight the bus within the image. Does that sound like a good example of what you are trying to achieve?

It would be useful if you could answer that question before we go too much further, as it is a complicated requirement, and we could waste a lot of time with solutions that are not relevant.

Assuming for the moment that I have correctly understood what you want, have you already got in place a method for identifying the various elements of your images. So, staying with the above example, are you somehow able to determine the coordinates of the bus within the image? And are those coordinates stored in a way that your program can understand?


Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Image based Data entry using image coordinates

Off the cuff, it sounds like someone trying to write a 'defeater' for the Captur system

happy shades


Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: Image based Data entry using image coordinates


Yes that's what is the requirement. We are doing data entry of a customer application form in PDF or JPG format. So, when operator wants to enter the customer name, the name portion of the form should be highlighted, when the user tabs to address field, the highlight should move to address portion and so on and so forth. I am not able to understand how to use coordinates to a) highlight on the image / PDF c) use those coordinates to make my VFP program move the highlight on the image as required.

Appreciate the responses.


RE: Image based Data entry using image coordinates


Can we assume that all the images have the same layout? In other words, does the name portion (for example) always have the same coordinates relative to the image?

If so, that makes it a bit easier. To start with, you will need a look-up table (which could be a DBF, a cursor, an array or something similar) that contains, for each field, the coordinates of field's top-left corner within the image, and its height and width.

Next, place an image control on the form. Set its Picture property to the image you wish to display.

Now place a shape control on the form. Never mind for the moment where it is placed. Set its BackStyle to 0 - Transparent. Change its BorderColor, BorderStyle and BorderWidth to suit you preferences. And from the Format menu, bring it to the front.

When the user indicates which field they want to edit, look that field up in your lookup table. Set the shape's Left and Top properties to the coordinates you have stored. Then set its Height and Width properties to the relevant values.

I have simplified the explanation, but it should give you a good start.

If, on the other hand, you are using different images and you don't don't know in advance the location of each field within the image, the whole thing is much more difficult, and possibly beyond the scope of VFP.

By the way, you can't use a VFP image control to display a PDF, so you should save the images as a JPG, BMP or something similar.


Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Image based Data entry using image coordinates

With PDF I think of PDF forms and remember there was Amyuni with a COM interface. That would shift the whole project, I assume, as there is no need for any conversion OCR, as users enter data into such PDFs that's retrievable.

An ex-colleague had the job to use electric paper for a case of questionnaires in paper form.

And image manipulation would be easy using the GdiplusX library from the VFPX project, but PDFs are not images, they are documents and the way to handle them usually means forwarding that task to either a PDF reader you start via shellexecute or embedding a browser control and making use of the ability of IE to display PDFs, both give you little control about this, ie addressing a page.

Wondering what coordinates you actually have in which form, you can, of course, put controls on top of others, ie a shape with its background set to transparent using the border to mark this area. That would be the easiest way. But since a PDF can be zoomed within the webbrowser control you won't know whether your coordinates must be recalculated. Even if, as Mike asked, the layout is constant.

When you'd even use the separate PDF reader process window, you obviously couldn't put a VFP control on top. Actually that's already problematic on ActiveX controls, as they are their own windows and actually just tested it: A shape you put in front of a webbrowser control and that shows itself at design time is drawn over at runtime, so the inner rectangle of an ActiveX control actually is not under your control but over it (sorry).

Bye, Olaf.

Olaf Doschke Software Engineering

RE: Image based Data entry using image coordinates


Have you had time to try my suggestion? How well did it work? It would be useful to hear your feedback, and possibly helpful to others who might have a similar requirement.


Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Image based Data entry using image coordinates

Hi Mike

I tried out your suggestion but somehow does not meet my requirements as I have to work with PDF files. Would you or anyone here know how to use the Kodak image annotation control activex with vfp? though Im not sure whether I can use PDF files in this. Or is there any similar activex that I can use for PDF files? I need annotation features as I have mentioned above, which would be helpful in developing data entry screens based on PDF documents.

Thanks in advance.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close