Bitmap Reading And Writing – Visual Basic 2008 Express

Environment
A Windows Machine running Windows XP Pro Sp3 1.73GHz 1GB RAM
Windows Visual Basic 2008 Express Edition

Data
A small number (approx 5 but could vary) of Bitmap files in a single specific directory
Bitmap files are 24 bits per pixel format, they are frames extracted from a video. An example one is attached.
Format could be for example 320 x 240 pixels but code needs to be able to deal with different dimensions.

Process
I want VB Source Code provided in a Project File which I can then Build and Run in Visual Basic 2008 Express Edition to do the following two main processes.

Process 1
1a. Process all Bitmap files in the specified directory (directory could be a fixed parameter written in program initialisation, as long as I can edit if needed, unlikely to change often).

1b. For each Bitmap file (say called nnnnnn.bmp) found, extract all the RGB values of the Pixels in the image and write them to an ascii CSV file call nnnnnn.txt with each line in ASCII file representing 1 pixel. Suggested line format is(X-Offset, Y-Offset, Red Value, Green Value, Blue Value). The ASCII files to be written to a different specific directory.

[ I will then read the pixel data into a separate non-VB program and process it. Later I will then update the nnnnnn.txt files with updated pixel values based on the processing in the nnnnnn.txt type files but keeping the same overall format. ]

Process 2
This is essentially the reverse of Process 1
2a. Process all ascii files with names nnnnnn.txt in the specified directory described in process 1b which have now been modified by me.

2b. For each ascii file (say called nnnnnn.txt) found, read the RGB values and create a BitMap file named nnnnnn2.bmp with the same dimenstions as the original bitmap. The only difference is the value of the pixels and the 2 in the filename.

General points
This code is for personal use and will only be used by me.
1. There is no real time requirement for the code.
2. Look and feel is not important just a rudimentary program to do the processing and give most basic progress information such as “Processing File nnnnnn.bmp”
3. Code MUST NOT be VB6 and should run without modification (apart from setting directory parameters)in Visual Basic 2008 Express.

I would have written the code myself but have very very little time and this is only for hobby purposes anyway. I have some minimal experience of VB (version 3!) but almost no time to learn the VB 2008 IDE and also BitMap processing with GetPixel, LockBits etc etc hence the request.

Please quote me if you are interested in doing the work.

Mark

Leave a Reply

Your email address will not be published. Required fields are marked *