Skip to content

DrawImage

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

Blitz3DBlitzPlusBlitzBasic

DrawImage

DrawImage:Void image:Int32, x:Int32, y:Int32, frame:Int32=0
Parameter Mode Type Default Description
image In Int32 required The image to draw.
x In Int32 required Horizontal position of the handle of the image.
y In Int32 required Vertical position of the handle of the image.
frame In Int32 0 Which frame to draw. Defaults to 0.

Description

Draws a frame of an image at a position. The handle of the image, which is its top left corner unless HandleImage, MidHandle or AutoMidHandle says otherwise, ends up at the position. Pixels with the mask color of the image (black unless MaskImage changed it) are left out, so the picture can have any shape. Drawing is clipped by the viewport, and the Origin moves it.

Differences

  • A frame number that does not exist stops the program with an error message.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Local ball = CreateImage(40, 40)
SetBuffer ImageBuffer(ball)
Color 255, 120, 0
Oval 0, 0, 40, 40, 1
Color 255, 230, 160
Oval 8, 6, 12, 12, 1
SetBuffer BackBuffer()
Cls
For i = 0 To 7
	DrawImage ball, 20 + i * 36, 100 + Sin(i * 45) * 50
Next
Flip
WaitKey

Media

DrawImage

Related Commands

CopyImage, CreateImage, DrawBlock, DrawBlockRect, DrawImageRect, FreeImage, GrabImage, HandleImage

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally