Your Arduino MEGA has not enough RAM to buffer the content of the whole screen. You need to use paged drawing. See example PagedDisplayExampleSmallRam.ino
Or you can use GxEPD2_AVR which does paged drawing using picture loop. See GxEPD2_AVR_Example.
Your Arduino MEGA has not enough RAM to buffer the content of the whole screen. You need to use paged drawing. See example PagedDisplayExampleSmallRam.ino
Or you can use GxEPD2_AVR which does paged drawing using picture loop. See GxEPD2_AVR_Example.