This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,28 @@
# Raw Image
The **Raw Image** control displays a non-interactive image to the user. You can use this for purposes such as decorations or icons, and you can change the image from a script to reflect changes in other controls. The control is similar to the [Image](script-Image.md) control, but offers more options for animating the image and accurately filling the control rectangle. However, the Image control requires its Texture to be a [Sprite](https://docs.unity3d.com/Manual/class-TextureImporter.html), while the Raw Image can accept any Texture.
![A Raw Image control](images/RawImageCtrlExample.png)
## Properties
![](images/UI_RawImageInspector184.png)
|**Property:** |**Function:** |
|:---|:---|
|**Texture** |The texture that represents the image to display.|
|**Color** |The color to apply to the image. |
|**Material** | The [Material](https://docs.unity3d.com/Manual/class-Material.html) to use for rendering the image. |
|**Raycast Target** | Enable **Raycast Target** if you want Unity to consider the image a target for raycasting. |
|**Raycast Padding** | Space added to the [RectTransform](class-RectTransform.md) for raycasting. |
|**Maskable** | Enable **Maskable** to allow [Masks](script-Mask.md) to hide this object. |
|**UV Rect** |The image's offset and size within the control rectangle, in normalized coordinates (0.0 – 1.0). The edges stretch to fill the space around the UV rectangle. |
## Details
Since the Raw Image does not require a sprite texture, you can use it to display any texture available to the Unity player. For example, you might show an image downloaded from a URL using the [WWW](https://docs.unity3d.com/ScriptReference/WWW.html.md) class or a texture from an object in a game.
The _UV Rectangle_ properties allow you to display a small section of a larger image. The _X_ and _Y_ coordinates specify which part of the image is aligned with the bottom left corner of the control. For example, an X coordinate of 0.25 will cut off the leftmost quarter of the image. The _W_ and _H_ (ie, width and height) properties indicate the width and height of the section of image that will be scaled to fit the control rectangle. For example, a width and height of 0.5 will scale a quarter of the image area up to the control rectangle. By changing these properties, you can zoom and scale the image as desired (see also the [Scrollbar](script-Scrollbar.md) control).
For scripting information and a code example, refer to the [`RawImage`](xref:UnityEngine.UI.RawImage) API reference.