I'm sort of a beginner at VBasic. I can do a lot of the basics but I need a little help with changing a multi-color bitmap file to a black-&-white bitmap file.
I need to create a program that will read a multi-colored bitmap file and save it as a monochrome (black & white) bitmap file. I need to be able to perform the change in a single, efficient pass of the bitmap file.
The code should look at each pixel of the bitmap and determine if it's real close to white in color, if so, then the pixel should be changed to pure white ("real close" most likely needs to be defined by a numeric value that can be adjusted). If the pixel is real close to black then the pixel should be changed to pure black. This process needs to be done for every pixel that isn't pure black or pure white when the original file is open.
The monochrome bitmap file should then be saved to a separate file.
I know how to setup a lot of the standard parts of the program however I don't know how to access a single pixel, determine if it's closest to white or black, and then change the pixel. I also don't know how to look at each pixel in an orderly fashion throughout the bitmap.
I suspect that I might need to call and use some type of win32 API from VBasic but I'm not sure....I also don't know how to call a Win32 API from VBasic.
Help?
thanks,
Jerry
I need to create a program that will read a multi-colored bitmap file and save it as a monochrome (black & white) bitmap file. I need to be able to perform the change in a single, efficient pass of the bitmap file.
The code should look at each pixel of the bitmap and determine if it's real close to white in color, if so, then the pixel should be changed to pure white ("real close" most likely needs to be defined by a numeric value that can be adjusted). If the pixel is real close to black then the pixel should be changed to pure black. This process needs to be done for every pixel that isn't pure black or pure white when the original file is open.
The monochrome bitmap file should then be saved to a separate file.
I know how to setup a lot of the standard parts of the program however I don't know how to access a single pixel, determine if it's closest to white or black, and then change the pixel. I also don't know how to look at each pixel in an orderly fashion throughout the bitmap.
I suspect that I might need to call and use some type of win32 API from VBasic but I'm not sure....I also don't know how to call a Win32 API from VBasic.
Help?
thanks,
Jerry