How to resize a GUILayout.Box? (Editor Window)

Hey all I’m working on an editor window that I plan to put on the asset store but my brg wont resize properly.

For the brg in this editor window I have a byte array that stores the image data. When the window opens, the byte data is converted to Texture2D and a GUILayout.Box shows the Image. Now I would Like for this box to scale with the window but when I try to resize the Texture2D, the Image Goes to what I’m assuming is a default graphic and does not resize properly. Is there a way to either get the texture to resize properly or to just resize the box?

thanks for your help as always
and sorry if I missed something that would have answered this question.

GUILayout.Box’s image maintains the resolution of image, if you are setting image as background, you can use

I haven’t used it in EditorGUI but it should work, or you can use
Unity - Scripting API: GUILayout.BeginArea and then with required a rect, and you can fit your gui inside that rect.

1 Like

Thanks that works great!