/// <summary>
        /// Info String drawn at the bottom of the Preview
        /// </summary>

        public override string GetInfoString()
        {
            FillableRawImage rawImage = target as FillableRawImage;

            // Image size Text
            string text = string.Format("FillableRawImage Size: {0}x{1}",
                                        Mathf.RoundToInt(Mathf.Abs(rawImage.rectTransform.rect.width)),
                                        Mathf.RoundToInt(Mathf.Abs(rawImage.rectTransform.rect.height)));

            return(text);
        }
        /// <summary>
        /// Draw the Image preview.
        /// </summary>

        public override void OnPreviewGUI(Rect rect, GUIStyle background)
        {
            FillableRawImage rawImage = target as FillableRawImage;
            Texture          tex      = rawImage.mainTexture;

            if (tex == null)
            {
                return;
            }

            Rect outer = rawImage.uvRect;

            outer.xMin *= rawImage.rectTransform.rect.width;
            outer.xMax *= rawImage.rectTransform.rect.width;
            outer.yMin *= rawImage.rectTransform.rect.height;
            outer.yMax *= rawImage.rectTransform.rect.height;

            SpriteDrawUtility.DrawSprite(tex, rect, outer, rawImage.uvRect, rawImage.canvasRenderer.GetColor());
        }
        /// <summary>
        /// Allow the texture to be previewed.
        /// </summary>

        public override bool HasPreviewGUI()
        {
            FillableRawImage rawImage = target as FillableRawImage;

            return(rawImage != null);
        }