Errors reading bitmap files in VB5

Posted on 2009-02-18
Last Modified: 2012-05-06

I have an application which monitors a video signal through a WinTV capture card, capturing a single frame then analysing the contents.  This is working fine on 2 machines here but it has now been deployed abroad and there is some strange behaviour occurring.

Randomly in the middle of the image the RGB pixel data seems to get out of step, see below:

Start of the file (fine)
 15 , 19 , 24
 23 , 24 , 16
 22 , 15 , 22
 18 , 21 , 21
 18 , 25 , 18
 25 , 17 , 21

Middle of the file (values shifting one place each time)
 28 , 255 , 43
 255 , 38 , 44
 32 , 38 , 255
 38 , 255 , 47
 255 , 38 , 55
 26 , 49 , 255
 56 , 255 , 28

The image looks fine visually so can't work out whats going on.  My read code is as follows:

    WinTV.SaveToDiskEx ("c:\capture.bmp")
    Open "c:\capture.bmp" For Binary As #14
    Lock #14
    Get #14, , fileheader
    Get #14, , imageheader
    ReDim bimage(imageheader.width - 1, imageheader.height - 1)
    Get #14, , bimage
    Unlock #14
    Close #14

where bimage is an array of type pixel which has individual bytes for b, g and r fields.

Could this be a memory or cache issue?  Both machines are running a similar spec (Win XP, 512MB ram etc).

Any ideas would be great.
Question by:fvcctv
    1 Comment

    Accepted Solution

    Turns out the driver for the WinTV card was corrupt or incorrect on the deployed machine.  Reloaded with the same version I am using here and all sprung into life...

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now