---
tags:
    - "UI, User, Interface"
---

# Image Set Native Size

[UI](../../index.md) / [Graphic](../index.md) / [Image](index.md) / **Image Set Native Size**

## Description

Executes the Set Native Size method on the Image component

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Image Set Native Size")]
    [Category("UI/Graphic/Image/Set Native Size")]
    [Description("Executes the Set Native Size method on the Image component")]
    
    [Image(typeof(IconUIImage), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface")]
    
    [Serializable]
    public class GenInstructionImage_SetNativeSize_0 : Instruction
    {
        [SerializeField] private GetGameObject m_Image = new GetGameObject(
            new GenTypeGameObject_Image()
        );
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Native Size");
            return $"{this.m_Image} {method}";
        }
        
        protected override Awaitable Run(Args args)
        {
            Image component = this.m_Image.Get<Image>(args);
            if (component == null) return Done;
            
            component.SetNativeSize();
            
            return Done;
        }
    }
}


```

