0

Is it possible in c# like in c++, to write to file bit by bit. for exmaple write one bit every iteration of for loop.

 void QT (int MINX, int MAXX,int MINY, int MAXY){
    short val = (short)normalizedImg[MINX, MINY];
    for(int x = MINX; x < MAXX; x++){
        for(int y = MINY; y < MAXY; y++){
            if (val != (short)normalizedImg[x,y])
                //Math.Pow(val - (short)normalizedImg[x, y], 2) > Math.Pow(T, 2)
                { 
                //writebit(1);
                QT(MINX,(MINX+MAXX)/2,MINY,(MINY+MAXY)/2);
                QT(MINX,(MINX+MAXX)/2,(MINY+MAXY)/2,MAXY);                
                QT((MINX+MAXX)/2,MAXX,MINY,(MINY+MAXY)/2);
                QT((MINX+MAXX)/2,MAXX,(MINY+MAXY)/2,MAXY); 
                return;
                }
            }

        }
        //Writebit(0)

    }

The problem is if I'd do this with the help of string, things get very slow very fast.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Rok Potočnik
  • 137
  • 13

0 Answers0