Foros del Web » Programando para Internet » ASP Clásico »

equivalente en asp de imagecreatetruecolor php

Estas en el tema de equivalente en asp de imagecreatetruecolor php en el foro de ASP Clásico en Foros del Web. alguien sabe como puedo hacer lo mismo que hace el imagecreatetruecolor en php en asp les paso un codigo que encontre en php que quiero ...
  #1 (permalink)  
Antiguo 24/06/2010, 12:00
Avatar de Fabu_dina  
Fecha de Ingreso: enero-2004
Mensajes: 425
Antigüedad: 20 años, 4 meses
Puntos: 1
equivalente en asp de imagecreatetruecolor php

alguien sabe como puedo hacer lo mismo que hace el imagecreatetruecolor en php en asp les paso un codigo que encontre en php que quiero hacer en asp

Código:

<?php
error_reporting(0);
/**
 * Get the width and height of the destination image
 * from the POST variables and convert them into
 * integer values
 */
$w = (int)$_POST['width'];
$h = (int)$_POST['height'];
// create the image with desired width and height
$img = imagecreatetruecolor($w, $h);
// now fill the image with blank color
// do you remember i wont pass the 0xFFFFFF pixels 
// from flash?
imagefill($img, 0, 0, 0xFFFFFF);
$rows = 0;
$cols = 0;
// now process every POST variable which
// contains a pixel color
for($rows = 0; $rows < $h; $rows++){
    // convert the string into an array of n elements
    $c_row = explode(",", $_POST['px' . $rows]);
    for($cols = 0; $cols < $w; $cols++){
        // get the single pixel color value
        $value = $c_row[$cols];
        // if value is not empty (empty values are the blank pixels)
        if($value != ""){
            // get the hexadecimal string (must be 6 chars length)
            // so add the missing chars if needed
            $hex = $value;
            while(strlen($hex) < 6){
                $hex = "0" . $hex;
            }
            // convert value from HEX to RGB
            $r = hexdec(substr($hex, 0, 2));
            $g = hexdec(substr($hex, 2, 2));
            $b = hexdec(substr($hex, 4, 2));
            // allocate the new color
            // N.B. teorically if a color was already allocated 
            // we dont need to allocate another time
            // but this is only an example
            $test = imagecolorallocate($img, $r, $g, $b);
            // and paste that color into the image
            // at the correct position
            imagesetpixel($img, $cols, $rows, $test);
        }
    }
}
/*
//añade marca de agua, cambiar la ruta a la fuente TTF
$string="ymipollo.com";
$font = "/home/toro/mdn/test/thin.ttf";
$size=6;
$fsize = @ImagettFbbox($size,45,$font,$string);
$black  = imagecolorallocate($img, 0, 0, 0);
$white  = imagecolorallocate($img, 255, 255, 255);
$dx = abs($fsize[2]-$fsize[0]); $dy = abs($fsize[5]-$fsize[3]);
$x = (imagesx($img)/2) - ($dx/2); $y = (imagesy($img)-$dy)-10;
imagettftext($img,$size,45,300,$y,$black,$font,$string);
imagettftext($img,$size,45,301+1,$y+1,$white,$font,$string);        */

// print out the correct header to the browser
header("Content-type:image/jpeg");
// display the image
imagejpeg($img, "", 90);
imagedestroy($img);
?>
  #2 (permalink)  
Antiguo 24/06/2010, 16:00
Avatar de Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 22 años, 3 meses
Puntos: 146
Respuesta: equivalente en asp de imagecreatetruecolor php

Qué hace el imagecreatetruecolor en PHP?
  #3 (permalink)  
Antiguo 25/06/2010, 01:45
Avatar de Fabu_dina  
Fecha de Ingreso: enero-2004
Mensajes: 425
Antigüedad: 20 años, 4 meses
Puntos: 1
Respuesta: equivalente en asp de imagecreatetruecolor php

si te fijas en el codigo que puse son valores pasados por un flash que captura una fotografia desde una camara web.

Mi intension es hacer una pagina donde el usuario pueda tomarse una fotografia con su camara web y esa sea almacenada en una base de datos mysql en mi servidor en el archivo de php lo que hace es convertir los datos binarios en una imagen

Gracias

Etiquetas: asp, equivalente, php
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:20.