Trying to create a UI Image preview in Editor GUI

Hi everyone, trying to add a preview image in my Editor gui extension. Now I’ve not done much Editor GUI before but I’ve given it a go but not really getting anywhere.

I’ve created a slot for adding a UI Image but I would like to show a preview window of the image as a preview of the image would be extremely helpful.

I’ve looked at the docs here: Unity - Scripting API: EditorGUI.DrawPreviewTexture

But I’m getting the following error: Expression denotes a type', where a variable’, value' or method group’ was expected

Here is my Code:

inventoryItemList.itemList[viewIndex-1].cardIcon = EditorGUILayout.ObjectField ("Card Icon", inventoryItemList.itemList[viewIndex-1].cardIcon, typeof (Image), false) as Image;


                //Preview Image
                Texture texture = inventoryItemList.itemList[viewIndex-1].cardIcon.mainTexture;

                EditorGUI.DrawPreviewTexture(Rect(25,60,100,100), texture);

If anyone can help point me in the right direction that would be really great.

Thanks!

instead of Rect you should write new Rect