I solved my question. My error was to calculate altezzaCella and larghezzaCella in proportion to the dimensions of the screen.