Here's a little function I wrote that pastes an image into an image memblock. Useful at many times.
Syntax- WriteImageToMemblock(Memblock,Image,XPosition,YPosition)
Function WriteImageToMemblock(Mem,Img,X,Y)
memWidth=Memblock dword(Mem,0)
memHeight=Memblock dword(Mem,4)
memSize=Get Memblock size(Mem)
Mem2=1
while memblock exist(Mem2)
inc Mem2
endwhile
Make memblock from image Mem2,Img
mem2Width=Memblock dword(Mem2,0)
mem2Height=Memblock dword(Mem2,4)
mem2Size=Get Memblock size(Mem2)
Pos=(3+X+Y*memWidth)*4
If Pos<MemSize
for H=0 to mem2Height-1
for W=0 to mem2Width-1
Pos=(3+(X+W)+(Y+H)*memWidth)*4
Pos2=(3+(W)+(H)*mem2Width)*4
if Pos>11 and Pos<memSize
if Pos2>11 and Pos2<mem2Size
write memblock byte Mem,Pos,memblock byte(mem2,Pos2)
write memblock byte Mem,Pos+1,memblock byte(mem2,Pos2+1)
write memblock byte Mem,Pos+2,memblock byte(mem2,Pos2+2)
write memblock byte Mem,Pos+3,memblock byte(mem2,Pos2+3)
endif
endif
Next W
Next H
endif
Delete Memblock Mem2
Endfunction
My computer surpasses all the technologies of the day. What computer do I have?