вот держи
Graphics 800, 600, 32, 2
Local img_source = CreateImage(256,256)
SetBuffer ImageBuffer(img_source)
Color 255,255,0
Oval 4, 4, 248, 248, 1
Color 255,0,0
Oval 50, 80, 30, 30, 1
Oval 176, 80, 30, 30, 1
Rect 50, 180, 156, 20, 1
Local img = DeformImage(img_source)
DrawImage img, 0, 0
DrawImage img_source, 400, 0
WaitKey()
End
Function DeformImage(source, height=40, count=7)
Local x, y, y2
Local pix
Local w = ImageWidth(source)
Local h = ImageHeight(source)
Local img_deform = CreateImage(w, h+height*count)
Local buff = ImageBuffer(img_deform)
Local buff_source = ImageBuffer(source)
Local Aspect = h / count
SetBuffer buff
LockBuffer(buff)
LockBuffer(buff_source)
For y = 0 To h
If (y Mod Aspect) = 0 Then
Color 0, 0, 0
Rect 0, y2, w, height
y2 = y2 + height
EndIf
For x = 0 To w
pix = ReadPixel(x, y, buff_source)
WritePixel x, y2, pix
Next
y2 = y2 + 1
Next
UnlockBuffer(buff)
UnlockBuffer(buff_source)
SetBuffer FrontBuffer()
Return img_deform
End Function