I don't see where I write to the screen. It's just 'printf'.
printf prints text to the console window and the console window is on the Workbench screen, isn't it?
I understood that while I read or copy the screen bitmap it can change. That's why the lock.
That's correct. What I wanted to point out is that you should not go the route of locking and directly accessing the bitmap data if there is a function which does the whole job for you. If you lock the bitmap and access the bitmap data directly, you have to be aware of all the possible pixel formats, 15bit, 16bit, 24bit, 32bit, each in big endian or little endian order. With the ReadPixelArray function you can choose that you want to receive 24bit RGB data. With direct bitmap access you have to do all the conversion yourself.
By the way, if your target platform is not limited to OS4 only, you should consider to use Cybergraphics API instead of Picasso96. Because CGX programs work on both CGX and P96, your program will work on all RTG systems on all AmigaOS flavours, even MorphOS and AROS. With P96 you limit the user base to AmigaOS4 users and the part of the AmigaOS3 users which use P96.