I'm making a program to automatically perform certain edits on images.
One of the functions is converting "white" pixels to "white" and transparent. Initially, all is well.
I have managed to convert a 24bppRGB image to a 32bppRGB image with the required pixels all transparent.
The image loads in picturebox and can be opened once saved.
The problem arose when I tried to re-edit the file. When I tried to extract the raw pixel data again, I got nothing. As far as I can tell the entire pixel data array is 0's.
Why is this the case?
^This is my main question. Outside of that problem, I also noticed a few quirks with the program, these are just out of curiosity:
What's the difference between:
for(int i = 0; i < (x + 1); i += y)
and
for(int i = 0; i <= (x); i += y)
And also:
byte = 4;
for(int i = 0; i < x - byte; i += byte)
and
for(int i = 0; i < x - byte; i += 4)
The 2nd one caused a AccessViolationException when I unlocked the bitmap.
If possible, keep the explanation as simple as possible. I'm a fairly new at this. Thanks for your time.