dilevin / computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
1 stars 7 forks source link

Unsigned char only saved as characters and display black #30

Open zxzxzx131313 opened 4 years ago

zxzxzx131313 commented 4 years ago

If you are experiencing the same problem where the unsigned char saved to be ascii characters not numbers and the images appeared to be black, you can do any of the following:

  1. Cast them to integers.
  2. Use to_string to convert and save them.
  3. Add a plus sign in front of the variables to force conversion when you write to file using std fstream.

Confirmed with professor that any above approach is fine as long as the image shows. Hope this helps.