7 Segment off LEDs Problem

szacpp:
I used bc548 transistor, but the transistor did not solve the problem. any idea?

Sorry, I thought your problem was that some segments were brighter than others. But I now think it is that some segments that should be off are still a little bit on. (It is still a good idea to not have i/o pins sink 7 LEDs.)

You may be looking at ghosting. This is what Rintin is hinting at too.
Did you try a small delay between setting the old digit low and shifting out the segments,
or between latching out the segments and setting the new digit high, or both?

Does it still happen if you display only one digit? By removing any 2 of the 3 cases in your Scanner() function? If it still happens, it is not ghosting.