You only need 4 * 1920* 1080 + 12 bytes for an image 1920 x 1080
That gives a memblock size of 8294412
The problem was your for x =12 to 8294412 should have been x=12 to 8294411
Here is code that creates the image without using the extra byte that will never be used or seen
// craft a white image
CreateMemblock(1, 8294412)
SetMemblockInt(1, 0, 1920)
SetMemblockInt(1, 4, 1080)
SetMemblockInt(1, 8, 32)
for x = 12 to 8294411
SetMemblockByte(1, x, 255)
next x
image = CreateImageFromMemblock(1)
CreateSprite(1, image)
do
Print( ScreenFPS() )
Sync()
loop
Unlike arrays...memblocks start at an offset of 0 and the highest byte in the memblock is the size of the memblock-1
If you want to set all 4 colours inside of the loop then make the step 4 and loop until you are 4 less than the memblock size...like this
// craft a white image
CreateMemblock(1, 8294412)
SetMemblockInt(1, 0, 1920)
SetMemblockInt(1, 4, 1080)
SetMemblockInt(1, 8, 32)
for x = 12 to (8294412-4) step 4
SetMemblockByte(1, x, 255) // red
SetMemblockByte(1, x+1, 255) // green
SetMemblockByte(1, x+2, 255) // blue
SetMemblockByte(1, x+3, 255) // alpha value
next x
image = CreateImageFromMemblock(1)
CreateSprite(1, image)
do
Print( ScreenFPS() )
Sync()
loop
In any case...if you want a memblock with a solid colour in it, the fastest and easiest code is simply to make a single pixel image (CreateImageColor()) and resize it (ResizeImage()) then create the memblock from that. Huge loops in interpreted basic are not really very fast really.