Hello!
I've edited an bitmap in c# and for every pixel i've changed it to a certain color if a condition was true else i've set the color to Color.Transparent ( the operations were done with getPixel/setPixel ) . I've exported the image in .png format but the image isn't transparent. Any ideas why or how should i do it ?
Regards, Alexandru Badescu
here is the code : -- here i load the image and convert to PixelFormat.Format24bppRgb if png
m_Bitmap = (Bitmap)Bitmap.FromFile(openFileDialog.FileName, false);
if(openFileDialog.FilterIndex==3) //3 is png
m_Bitmap=ConvertTo24(m_Bitmap);
-- this is for changing the pixels after a certain position in an matrix
for (int i = startX; i < endX; i++)
for (int j = startY; j < endY; j++)
{
if (indexMatrix[i][j] == matrixFillNumber)
m_Bitmap.SetPixel(j, i, selectedColor);
else
m_Bitmap.SetPixel(j, i, Color.Transparent);
}