Ver Mensaje Individual
  #5  
Antiguo 15-12-2014
aposi aposi is offline
Miembro
 
Registrado: dic 2006
Posts: 146
Reputación: 18
aposi Va por buen camino
El codigo tiene que quedar así:

Código PHP:
int ContarDivisionesImagenAnsiString rutaint maxWidthint maxHeight)
{
   
//Solicito memoria para el bitmap que contendrá el concatenado de imagenes
   
Graphics::TBitmap *bmp = new (nothrowGraphics::TBitmap();
   
int divisiones 0;
   
int divisionesWidth 0;
   
int divisionesHeight 0;
   if(
bmp != NULL)
   {
      
bmp->LoadFromFile(ruta);

      
int TotalWidth bmp->Width maxWidth;
      
int TotalHeight bmp->Height maxHeight;

      while( 
TotalWidth 0)
      {
         
TotalWidth -= maxWidth;
         
divisionesWidth++;
      }
      while( 
TotalHeight 0)
      {
         
TotalHeight -= maxHeight;
         
divisionesHeight++;
      }
      
delete bmp;
      if 
divisionesHeight != {
           if 
divisionesWidth != {
              
divisiones divisionesHeight divisionesWidth;
          }else {
             
divisiones =  divisionesHeight;  
          }
      }else { 
             
divisiones divisionesWidth;
     }
    
   }else{
      
divisiones = -1;
   }
   return 
divisiones;

Responder Con Cita