drawing a base64-pic in editor

In this gorgeous attempt, a picture shall be included in a js-script instead of placing it as a 2nd file in the script’s folder. A nifty thing when giving a script to someone else. The problem maybe is the proper usage of unitys texture-functions.

A png shall be drawn as a logo in a window in unity’s editor, using base64. This is the summary of that code:

//Import .Net-base64-functions:
import System;		//base64
import System.Text;	//base64

class wintitle extends EditorWindow {

 @MenuItem("MyMenu/Start")
 static function Init() {	
	var window = GetWindow(wintitle);	
	window.position = Rect(300, 200, 210, 300);
	window.Show();				
  }//end static function


//Prepare logo
   var logobase64 : String = [some base64-stuff];
   var dummy : boolean;
   var logoloaded : boolean = false;
   var logoraw : Object;
   var logotex : Object;


function OnGUI() { 
    // Convert logo only once
    if (!logoloaded){     
     logoraw = Convert.FromBase64String (logobase64);
     logotex = new Texture2D (200, 102, TextureFormat.ARGB32, false); 	
     logoloaded = true;
    }//endif
    
    logotex.LoadImage(logoraw);
    dummy = EditorGUILayout.Button(GUIContent.image(logotex));

 }//end ongui
}//endclass  

What it should to: Conveting base64 (the png-file) into raw. Then convert raw into a Texture2D. Finally draw a button with that texture in the window.

The compiler says:

BCE0020: An instance of type ‘UnityEngine.GUIContent’ is required to access non static member ‘image’.

How do I correct the error?

I think the problem has something to do with:

logoraw = Convert.FromBase64String (logobase64);

and

logotex.LoadImage(logoraw);

Maybe Loadimage only accepts bytearrays. It also could be related to the texture-variable

logotex = new Texture2D (200, 102, TextureFormat.ARGB32, false); 

which I defined as Texture2D and it’s format to ARGB32. There also is a var-type Texture but I don’t know how to use it. I saw the above line in an example in the documentation. However, is there a way to create a bytearray manually? I think that’s actually the problem: Loadimage get’s raw-data instead of a byte-array. The logoraw=-line needs to become extended somehow.