Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/04/2010, 09:36
Avatar de enzoscuro
enzoscuro
 
Fecha de Ingreso: mayo-2004
Ubicación: hcda el carmen pan de azu
Mensajes: 51
Antigüedad: 20 años
Puntos: 0
Solucionado: Problema con Web Services

Solucionado!!!

Código PHP:
    /**
     * Metodo que decodifica un string en base64 dirigido para una imagen del tipo PNG
     * @param string data, string codificado en base64
     * @return byte[], con el contenido texto de la imagen
     */ 
    
public static byte[] base64Decode(string data)
    {     
    
        
MemoryStream memory = new MemoryStream(Convert.FromBase64String(data));
        
System.Drawing.Image result System.Drawing.Image.FromStream(memory);        
        
memory.Close();
        
        
memory = new MemoryStream();
        
result.Save(memorySystem.Drawing.Imaging.ImageFormat.Png);

        
byte[] imageContent = new Byte[memory.Length];

        
// rewind the memory stream
        
memory.Position 0;

        
// load the byte array with the image
        
memory.Read(imageContent0, (int)memory.Length);

        return 
imageContent;
    } 
//------------------------------------------------------------------------------------------------
luego se imprime el byte[]
//------------------------------------------------------------------------------------------------
Código PHP:
      Response.Clear();
      
Response.ContentType "image/png";
      
// return byte array to caller with image type        
      
Response.BinaryWrite(this.getGraficoPNG(data));
       
Response.End(); 
__________________
El viento sopla en el oeste...