After playing with code, I'm stuck. There's something in TBimap, TPicture, TPaintBox and TCanvas that I don't understand. Sometimes they don't render what is supposed to. I'm tired of this so I decided to hack the Allegro.pas' demo map editor. Fortunately I can borrow some stuff from the work I did.