Question: c++ See the attached .bmp's for reference. Here are some clues on how you should implement this program: Save any two image files you want
c++
See the attached .bmp's for reference.
Here are some clues on how you should implement this program:
Save any two image files you want into your project directory. Either download them as .bmp files or open them with mspaint and save them as 24-bit .bmp files
Ask the user to enter the two file names, without the .bmp extensions
Open both files using separate fstream objects (don't forget to set the binary flag)
Read each file into its own Image struct
Determine which file has the smallest width and which has the smallest height, in pixels, and store the smallest width and height as variables. You don't want your overlay to write out of the boundaries of a smaller image.
Loop through your pixel arrays, stopping at the smallest width and smallest height.
Write every other pixel's "bgr" values from the second image into the first image.
This will create the effect of one image blurring into the other, since pixels from both images will be present.
You may want to use a bool and toggle its value each time the loop advances, and copy over the bgr values only when it is true.
When the loop is finished, write the modified pixel struct back into the first image file.
Close both files and deallocate each Image struct's pixel arrays.
You don't have to upload the images you used, unless you want to. I should be able to test your code with any two 24 bit .bmp's.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
