Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen Scrape to review image properties

Status
Not open for further replies.

Wholsea

Programmer
Jun 16, 2004
138
US
Is it possible to use a screen scrape to A. validate that an image loaded, and B. what the dimensions and size (kb) said image is?

ASP, VB, VBS, Cold Fusion, SQL, DTS, T-SQL, PL-SQL, IBM-MQ, Crystal Reports, Crystal Enterprise
 
In theory, most of this is possible. You will not be able to determine the size(kb) of the image because a displayed image is just a dummed down version of a true image in most cases and you do not know the original file format. Here is what I would do to determine the other information you need.

1. Make a big pot of coffee
2. Get some good snackage.
3. Determine the location of the window on the desktop that contains the image you are analyzing.
4. Take a snapshot (image) of the area you are analyzing. (Look up how to get a print screen of an area of the desktop).
5. Break down the image so that you can analze each individual pixels RGB value information.
6. Using the RGB information found in the upper left corner of your snapshot you should be able to determine the background color.
7. Once you have this information you should be able to determine differences in RGB values as you analyze from the top left to the bottom right of your image area. As you find the start and stop points of this information log the vertical and horizontal coordinates of each corner of the image.
8. Calculate the size of image in pixels based on your 4 corner points.
9. If you do not find any pixel variations inside your image area then you do not have an image displayed.
10. Say good morning to all your coworkers that left you last night somewhere around step 4.

stravis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top