Bonjour à tous !

Merci pour ce forum que j'ai pas mal consulté depuis que je me suis mise au php !
J'ai une question concernant imagecreatetruecolor.

A partir d'un flash, j'exporte une image avec imagecreatetruecolor.
Le problème c'est que je dois exporter l'image en300dpi et en CMJN.
Mon flash crée l'image et l'enregistre grace à on fichier php.

Cependant, avec ma fonction imagecreatetruecolor, je ne sais pas comment exporter en cmjn au lieu de rgb. Et en 300 dpi.

Dans ma source je définis les variables de tailles $width, $height (celle de ma scène flash) et la conversion en RGB.

Quelqu'un saurait comment exporter en cmjn et 300dpi ? Voici ma source :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
$imagefinale = $_POST['createTime']."_".$_POST['firstname']."_".$_POST['lastname'];
$width = (int)$_POST['width'];
$height = (int)$_POST['height'];
 
// creation de l'image avec les dimensions souhaitées
$image = imagecreatetruecolor($width, $height);
// remplit l'image avec couleur blanc 0xFFFFFF pixels 
imagefill($image, 0, 0, 0xFFFFFF);
$rows = 0;
$cols = 0;
// now process every POST variable which
// contains a pixel color
for($rows = 0; $rows < $height; $rows++){
	// convert the string into an array of n elements
	$c_row = explode(",", $_POST['px' . $rows]);
	for($cols = 0; $cols < $width; $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
			$background = imagecolorallocate($image, $r, $g, $b);
			// and paste that color into the image
			// at the correct position
			imagesetpixel($image, $cols, $rows, $background);
		}
	}
}
imagejpeg($image,"./imagesuploads/".$imagefinale.".jpg");
imagedestroy($image);
Merci