There are many cases where we wish to display an image onscreen, including logos, maps, icons, and splash graphics. In this recipe, we will display an image centered at the top of the screen.
The following screenshot shows Unity displaying an image:

There are many cases where we wish to display an image onscreen, including logos, maps, icons, and splash graphics. In this recipe, we will display an image centered at the top of the screen.
The following screenshot shows Unity displaying an image:

For this recipe, we have prepared the image that you need in a folder named Images in the 01_07 folder.
To display an image, follow these steps:


You have ensured that an image has the Texture Type set to Default. You added a UI RawImage control to the scene. The RawImage control has been made to display the unity_logo image file.
The image has been positioned at the top-center of the Game panel.
There are some details you don't want to miss:
If you simply wish to display non-animated images, then Texture images and UI RawImage controls are the way to go. However, if you want more options on how an image should be displayed (such as tiling, and animation), the UI Image control should be used instead. This control needs image files to be imported as the Sprite (2D and UI) type.
Once an image file has been dragged into the UI Image control's Sprite property, additional properties will be available, such as Image Type, and options to preserve the aspect ratio.
If you wish to prevent the distortion and stretching of a UI Sprite GameObject, then in the Inspector panel, check the Preserve Aspect option, in its Image (Script) component.
An example of tiling a Sprite image can be found in the Revealing icons for multiple object pickups by changing the size of a tiled image recipe in Chapter 3, Inventory UIs.