Search Unity

Facebook screenshot

Discussion in 'Scripting' started by kdarius43, Aug 2, 2015.

  1. kdarius43

    kdarius43

    Joined:
    Mar 16, 2015
    Posts:
    170
    Hello all i have the fallowing code
    Code (CSharp):
    1.         yield return new WaitForEndOfFrame();
    2.        
    3.         var width = Screen.width;
    4.         var height = Screen.height;
    5.         var tex = new Texture2D(width, height, TextureFormat.RGB24, false);
    6.         // Read screen contents into the texture
    7.         tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
    8.         tex.Apply();
    9.         byte[] screenshot = tex.EncodeToPNG();
    10.        
    11.         var wwwForm = new WWWForm();
    12.         wwwForm.AddBinaryData("image", screenshot, "InteractiveConsole.png");
    13.        
    14.  
    15.         FB.API("me/photos", Facebook.HttpMethod.POST, Callback, wwwForm);
    16.        
    17.         Debug.Log ("Uploaded");
    but i keep getting the error
    the name 'Callback' does not exist in the current context.

    any thoughts?
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You'll need to include the code where you define Callback.

    If you don't have this code, then that's your problem.
     
  3. kdarius43

    kdarius43

    Joined:
    Mar 16, 2015
    Posts:
    170
    oh i dont have the code for callback. Any ideas on what this should be?