Be sure to look at the examples in
EncodeProject.zip.
 
read byte from msgfile
while not at msgfile eof
write outpixel to coded image
encode 00000000 (binary) in next 8 outimg pixels
read codedimg header
while(TRUE)
for i = 0 to 7
if byte == 00000000 (binary)
close all files
Type of Control Label or Caption for Control Edit Box Raw Image File Name Push Button Get Raw Image File Name Push Button Display Raw Image Edit Box Encoded Image File Name Push Button Get Encoded Image File Name Push Button Display Encoded Image Edit Box Input Text File Name Push Button Get Input Text File Name Push Button Display Input Text File Edit Box Output Text File Name Push Button Get Output Text File Name Push Button Display Output Text File Menu Item Encode Menu Item Decode Pseudocode for Encoding Algorithm of Encoding Project 4.
open origimg and msgfile for binary read
open codedimg for binary write
read origimg header
write codedimg header (don't forget endl at end of each line)
base = 10000000 (binary)
for i = 0 to 7
end while
read pixel from origimg
end for
mask = (base >> i)
if (byte & mask == 00000000 (binary))
outpixel = (pixel & 11111110 (binary))
else
outpixel = (pixel | 00000001 (binary))
end if
read byte from msgfile
copy remaining pixels unchanged to outimg file.
close all filesPseudocode for Decoding Algorithm of Encoding Project 4.
open codedimage for binary read
open outmsg for binary write
base = 10000000 (binary)
byte = 00000000 (binary)
end while
read pixel from codedimg
end for
bit = low order bit of pixel
mask = (base >> i)
if (bit = 00000001 (binary))
    byte |= mask    (or byte = byte | mask)
break out of loop
write byte to outmsg