> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/korean/development/api-reference/classes/imagelabel.md).

# ImageLabel

ImageLabel : `GuiLabel`

## Overview

ImageLabel은 Frame과 달리 사각형 영역에 지정한 이미지를 표시할 수 있는 UI 요소입니다.

이미지의 색상 보정이나 투명도 조절은 ImageColor3 및 ImageTransparency 속성으로 제어할 수 있으며, 배경을 숨기고 이미지만 표시하고 싶다면 BackgroundTransparency를 1로 설정하면 됩니다.

ImageLabel은 **클라이언트 환경**에서만 제어할 수 있습니다.

## Properties

### ContentImageSize

`Vector2`

Image에 지정한 원본 이미지의 크기를 픽셀 단위로 나타내는 읽기 전용 속성입니다.

이미지가 아직 로드되지 않았으면 (0, 0)입니다. Image를 바꾸면 새 이미지가 로드될 때까지 (0, 0)으로 돌아갑니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

print("ContentImageSize : ", ImageLabel.ContentImageSize)
```

### Image

`string`

ImageLabel에 표시할 이미지 에셋을 지정합니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.Image = "ovdrassetid://1234"
```

### ImageColor3

`Color3`

이미지에 적용되는 색상을 지정합니다.

색을 흰색으로 두면 원본 이미지가 그대로 표시되며, 다른 색을 지정하면 이미지 전체에 그 색조가 입혀집니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ImageColor3 = Color3.fromRGB(255, 0, 0)
```

### ImageRectOffset

`Vector2`

원본 이미지에서 표시할 영역의 왼쪽 위 시작 위치를 픽셀 단위로 지정합니다.

ImageRectSize와 함께 사용하면 여러 아이콘을 모아 둔 하나의 이미지(스프라이트 시트)에서 원하는 부분만 표시할 수 있습니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ImageRectOffset = Vector2.new(64, 0)
ImageLabel.ImageRectSize = Vector2.new(64, 64)
```

### ImageRectSize

`Vector2`

원본 이미지에서 표시할 영역의 크기를 픽셀 단위로 지정합니다.

표시할 영역의 시작 위치는 ImageRectOffset으로 지정합니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ImageRectOffset = Vector2.new(0, 0)
ImageLabel.ImageRectSize = Vector2.new(128, 128)
```

### ImageTransparency

`number`

이미지의 투명도를 지정합니다.

0은 완전한 불투명 상태를 의미하고, 1은 전혀 보이지 않는 상태를 의미합니다.

배경을 숨기고 이미지만 표시하고 싶다면 BackgroundTransparency를 1로 설정하면 됩니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ImageTransparency = 0.5
```

### IsLoaded

`boolean`

Image에 지정한 이미지가 로드되어 표시할 수 있는 상태인지를 나타내는 읽기 전용 속성입니다.

Image를 바꾸면 새 이미지가 로드될 때까지 false가 됩니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

print("IsLoaded : ", ImageLabel.IsLoaded)
```

### ResampleMode

`Enum.ResamplerMode`

이미지를 원본과 다른 크기로 표시할 때 픽셀을 보간하는 방식을 지정합니다.

* `Default`: 픽셀 사이를 부드럽게 보간합니다.
* `Pixelated`: 보간하지 않고 픽셀 경계를 그대로 유지합니다. 픽셀 아트처럼 선명한 경계가 필요한 이미지에 적합합니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ResampleMode = Enum.ResamplerMode.Pixelated
```

### ScaleType

`Enum.ScaleType`

UI 요소의 크기가 원본 이미지와 다를 때 이미지를 어떻게 조정할지 지정합니다.

* `Stretch`: 이미지를 요소의 크기에 맞게 늘립니다. 기본값입니다.
* `Slice`: 이미지를 아홉 개의 영역으로 나누고 각 영역에 서로 다른 조정 규칙을 적용합니다. 슬라이스 경계는 SliceCenter로 결정됩니다. Slice로 설정하면 SliceCenter와 SliceScale 속성이 함께 표시됩니다.
* `Tile`: TileSize 크기의 타일로 이미지를 반복해 표시합니다.
* `Fit`: 원본 비율을 유지한 채 이미지 전체가 요소 안에 들어가도록 크기를 맞춥니다.
* `Crop`: 원본 비율을 유지한 채 요소를 가득 채우도록 크기를 맞추고, 요소를 벗어나는 부분은 잘라냅니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ScaleType = Enum.ScaleType.Slice
```

### SliceCenter

`Rect`

ScaleType이 Slice일 때 아홉 개 영역의 슬라이스 경계를 지정합니다.

값은 이미지 좌상단(0, 0)을 기준으로 한 절대 픽셀 좌표이며, 좌상단 지점 Min과 우하단 지점 Max로 구성됩니다. Properties 창에는 X0, Y0, X1, Y1 네 개의 필드로 표시되며 각각 Min.X, Min.Y, Max.X, Max.Y에 대응합니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ScaleType = Enum.ScaleType.Slice
ImageLabel.SliceCenter = Rect.new(10, 10, 118, 118)
```

### SliceScale

`number`

ScaleType이 Slice일 때 슬라이스 테두리를 지정한 비율로 확대합니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ScaleType = Enum.ScaleType.Slice
ImageLabel.SliceScale = 2
```

### TileSize

`UDim2`

ScaleType이 Tile일 때 반복해서 표시할 타일 하나의 크기를 지정합니다.

Scale은 UI 요소 크기에 대한 비율이고 Offset은 픽셀 단위입니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local ImageLabel = ScreenGui:WaitForChild("ImageLabel")

ImageLabel.ScaleType = Enum.ScaleType.Tile
ImageLabel.TileSize = UDim2.new(0, 32, 0, 32)
```

## Methods

## Events

## See also

{% content-ref url="/pages/K1g0tEWDJhh6a6E4UURk" %}
[GUI](/korean/manual/studio-manual/gui.md)
{% endcontent-ref %}
