import{_ as a,a as t,b as r,ag as d}from"./chunks/framework.BcrMLAmg.js";const g=JSON.parse('{"title":"Image","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Image.md","filePath":"references/elements/Image.md","lastUpdated":1757844696000}'),i={name:"references/elements/Image.md"};function o(h,e,l,n,s,c){return r(),t("div",null,e[0]||(e[0]=[d('

Image

This is the Image element class which can be used to display bimg formatted images.Bimg is a universal ComputerCraft image format.See: https://github.com/SkyTheCodeMaster/bimg

Extends: VisualElement

Properties

PropertyTypeDefaultDescription
bimgtable{}The bimg image data
currentFramenumber1Current animation frame
autoResizebooleanfalseWhether to automatically resize the image when content exceeds bounds
offsetXnumber0Horizontal offset for viewing larger images
offsetYnumber0Vertical offset for viewing larger images

Functions

MethodReturnsDescription
Image:resizeImageImageResizes the image to the specified width and height
Image:getImageSizenumber, numberGets the size of the image
Image:getPixelDatafg, bg, charGets pixel information at position
Image:setTextImageSets the text at the specified position
Image:getTextstringGets the text at the specified position
Image:setFgImageSets the foreground color at the specified position
Image:getFgstringGets the foreground color at the specified position
Image:setBgImageSets the background color at the specified position
Image:getBgstringGets the background color at the specified position
Image:setPixelImageSets the pixel at the specified position
Image:nextFrameImageAdvances to the next frame in the animation
Image:addFrameImageAdds a new frame to the image
Image:updateFrameImageUpdates the specified frame with the provided data
Image:getFrametableGets the specified frame
Image:getMetadatatableGets the metadata of the image
Image:setMetadataImageSets the metadata of the image

Image:resizeImage(width, height)

Resizes the image to the specified width and height

Parameters

Returns

Image:getImageSize()

Gets the size of the image

Returns

Image:getPixelData(x, y)

Gets pixel information at position

Parameters

Returns

Image:setText(x, y, text)

Sets the text at the specified position

Parameters

Returns

Image:getText(x, y, length)

Gets the text at the specified position

Parameters

Returns

Image:setFg(x, y, pattern)

Sets the foreground color at the specified position

Parameters

Returns

Image:getFg(x, y, length)

Gets the foreground color at the specified position

Parameters

Returns

Image:setBg(x, y, pattern)

Sets the background color at the specified position

Parameters

Returns

Image:getBg(x, y, length)

Gets the background color at the specified position

Parameters

Returns

Image:setPixel(x, y, char, fg, bg)

Sets the pixel at the specified position

Parameters

Returns

Image:nextFrame()

Advances to the next frame in the animation

Returns

Image:addFrame()

Adds a new frame to the image

Returns

Image:updateFrame(frameIndex, frame)

Updates the specified frame with the provided data

Parameters

Returns

Image:getFrame(frameIndex)

Gets the specified frame

Parameters

Returns

Image:getMetadata()

Gets the metadata of the image

Returns

Image:setMetadata(key, value)

Sets the metadata of the image

Parameters

Returns

',95)]))}const u=a(i,[["render",o]]);export{g as __pageData,u as default};