TuxedoBerries.ScenePanel.Drawers.ScreenshotDrawer.DrawPreview C# (CSharp) Method

DrawPreview() public method

Draws the preview screenshot given the image path.
public DrawPreview ( string dataPath ) : bool
dataPath string Data path.
return bool
        public bool DrawPreview(string dataPath)
        {
            var texture = GetTexture (dataPath, false);
            EditorGUILayout.BeginVertical ();
            {
                // Get Texture
                if (texture != null) {
                    GUILayout.Label (texture, GUILayout.MaxWidth (MaxWidth (texture)), GUILayout.MaxHeight (MaxHeight (texture)));
                } else {
                    EditorGUILayout.LabelField ("[ Empty Screenshot ]", _column1);
                }

                // In Build Enabled Check
                if (!string.IsNullOrEmpty (dataPath)) {
                    EditorGUILayout.LabelField (System.IO.Path.GetFileName (dataPath), _column1);
                } else {
                    EditorGUILayout.LabelField ("--");
                }
                EditorGUILayout.LabelField ("Screenshot Size: ", _column1);
                string displayText;
                if (texture != null) {
                    displayText = string.Format ("{0} x {1}", texture.width, texture.height);
                } else {
                    displayText = "--";
                }
                EditorGUILayout.LabelField (displayText, _column1);
            }
            EditorGUILayout.EndVertical ();
            return texture != null;
        }