Skip to Content
Kinemium

ImageLabel

Display an image inside a user interface.

ImageLabel draws an image in a GUI layout. It supports tinting, transparency, sub-rectangles, nine-slice scaling, tiling, and resampling modes.

Getting started

local icon = Instance.new("ImageLabel")
icon.Size = UDim2.fromOffset(64, 64)
icon.BackgroundTransparency = 1
icon.Image = "rbxassetid://1234567890"
icon.ImageColor3 = Color3.fromRGB(255, 200, 80)
icon.Parent = screenGui

Properties

PropertyTypeAccessDescription
ImagestringRead/writeImage asset URI.
ImageContentContentRead/writeTyped content view of the image.
IsLoadedbooleanRead-onlyWhether the image has been loaded.
ImageTransparencynumberRead/writeTransparency, clamped to 0 through 1.
ImageColor3Color3Read/writeTint applied to the image.
ImageRectOffsetVector2Read/writeTop-left offset of the source rectangle.
ImageRectSizeVector2Read/writeSize of the source rectangle.
ResampleModeEnum.ResampleModeRead/writeFiltering when the image is scaled.
ScaleTypeEnum.ScaleTypeRead/writeStretch, tile, or slice behavior.
SliceCenterRectRead/writeNine-slice border rectangle.
SliceScalenumberRead/writeScale of the nine-slice border, minimum 0.
TileSizeUDim2Read/writeTile size when ScaleType is Tile.

Image accepts either a string URI or a Content value. Reading it returns the stored URI string. ImageContent is the typed form.

Assigning IsLoaded raises a read-only error.

Example: nine-slice panel

local panel = Instance.new("ImageLabel")
panel.Image = "rbxassetid://1234567890"
panel.ScaleType = Enum.ScaleType.Slice
panel.SliceCenter = Rect.new(16, 16, 48, 48)
panel.SliceScale = 1

Notes

  • ImageTransparency is clamped rather than rejected.
  • SliceScale clamps negative values to 0.
  • SliceCenter is only used when ScaleType is Slice.
  • TileSize is only used when ScaleType is Tile.
  • ResampleMode also accepts the older ResamplerMode enum; Pixelated maps to nearest-neighbor.
  • Inherits all GuiObject members.

See also

  • ImageButton for a clickable image.
  • Decal for images on 3D parts.
  • GuiObject for layout and appearance.

On this page