Display texture in a custom inspector?

I have a custom inspector that has a prefab field. I want to display an image of whatever is in that field in-line as a “preview”.

I have figured out render to texture but I cant figure out how to display the preview. I found EditorGUI.DrawPreviewTexture() but I am at a loss as to how I figure out the rectangle to display in. The rest of the inspector is drawn using EditorGUILayout.

Can someone explain this or point me at a working example script?



Texture2D myTexture = AssetPreview.GetAssetPreview(object);

Then, you can simply place the texture inside a label (or a button, or whatever you like).