Skip to content

SaveTexture

Narta Xaymar Dirks edited this page Nov 25, 2026 · 7 revisions

SaveTexture BlitzLLVM

SaveTexture:Int32 texture:Int32, file:String, frame:Int32=0, settings:String=""
Parameter Mode Type Default Description
texture In Int32 required The texture.
file In String required The path of the file to write.
frame In Int32 0 The frame to save. Defaults to 0.
settings In String "" How to encode the file, such as "quality=85". Defaults to an empty string.

Returns: 1 if the file was written, otherwise 0 (also for a frame that the texture does not have). With AsyncSaving on, 1 means that the save was queued, see SavesFailed.

Description

BlitzLLVM This command does not exist in the original Blitz products. BlitzLLVM adds it.

Writes one frame of a texture into a picture file, the same as saving its TextureBuffer with SaveBuffer. The format comes from the end of the file name (.bmp, .png, .jpg, .webp, .jxl, .tga, .dds, any other name is a BMP), and the optional settings choose how the file is made, see Saving pictures.

Examples

Graphics3D 320, 240, 0, 2
tex = CreateTexture(64, 64)
SetBuffer TextureBuffer(tex)
Color 255, 128, 0
Rect 0, 0, 64, 64, 1
Color 255, 255, 255
Oval 8, 8, 48, 48, 1
SetBuffer BackBuffer()
If SaveTexture(tex, "texture.png") Then Print "texture.png written" Else Print "could not save"
SaveTexture tex, "texture.jpg", 0, "quality=95,subsampling=444"
WaitKey

This is a BlitzLLVM extension: the originals can only save buffers and images.

Related Commands

AtlasTexture BlitzLLVM, CreateTexture Blitz3D, FreeTexture Blitz3D, LoadAnimTexture Blitz3D, LoadTexture Blitz3D, PositionTexture Blitz3D, RotateTexture Blitz3D, ScaleTexture Blitz3D

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally