Skip to content

GrabImage

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions

Blitz3DBlitzPlusBlitzBasic

GrabImage

GrabImage:Void image:Int32, x:Int32, y:Int32, frame:Int32=0
Parameter Mode Type Default Description
image In Int32 required The image to copy into.
x In Int32 required Left edge of the part of the buffer to copy.
y In Int32 required Top edge of the part of the buffer to copy.
frame In Int32 0 The frame to copy into. Defaults to 0.

Description

Copies a part of the current buffer into a frame of an image. The part has the size of the image and starts at the given position, so this is the way to take a screenshot into an image or to build a sprite from something that was drawn.

Differences

  • Parts that lie outside of the buffer are not copied and keep what the frame had before.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Local shot = CreateImage(80, 80)
Cls
Color 255, 80, 80
Oval 20, 20, 80, 80, 1
Color 80, 200, 255
Rect 60, 60, 60, 60, 1
GrabImage shot, 40, 40
Cls
For i = 0 To 2
	DrawBlock shot, 20 + i * 100, 80
Next
Flip
WaitKey

Media

GrabImage

Related Commands

CopyImage, CreateImage, DrawImage, FreeImage, HandleImage, LoadAnimImage, LoadImage, MaskImage

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally