View pict.xpx
<set NAME="phcdebug" VALUE="1">
<set NAME="i" value="0">
<html>
<head>
<title>TEST PHC VERSION $phcversion$</title>
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<meta HTTP-EQUIV="Expires" CONTENT="0">
</head>
<set name="fileDir" value="/files">
<cond expr="$proc$=exec">
<set name="filename1" value="image1">
<set name="filename2" value="image2">
<cond expr="!$Fimg1$">
<set name="Path_img1" value="$fileDir$/$filename1$">
<pict name="img1" content="$Fimg1$" dest="$Path_img1$" geth="H1" getw="W1"> <!-- ecrit image sur disque -->
Load image 1: $Fimg1.filesize$ octets<br>
<else expr="!$Path_img1$">
<pict name="img1" path="$Path_img1$" geth="H1" getw="W1"> <!-- charge image -->
<else>
<pict name="img1" with="$Nwidth$" height="$Nheight$"> <!-- cree une image vide -->
</cond>
<cond expr="$Nheight$"><set name="Nheight" value="$H1$"></cond>
<cond expr="$Nwidth$"><set name="Nwidth" value="$W1$"></cond>
<cond expr="!$Fimg2$">
<set name="Path_img2" value="$fileDir$/$filename2$">
<pict name="img2" content="$Fimg2$" dest="$Path_img2$" geth="H2" getw="W2"> <!-- ecrit image sur disque -->
Load image 2: $Fimg2.filesize$ octets<br>
<else expr="!$Path_img2$">
<pict name="img2" path="$Path_img2$" geth="H2" getw="W2"> <!-- charge image -->
</cond>
</cond>
<body BGCOLOR="#AAFFAA">
<a href="ViewFile.xpx?fileName=$phccurrentfile$">Voir le source</a>
<br>
<font FACE="Verdana">
<!------------------->
<h2>PICT TEST</h2>
<!------------------->
<form METHOD="post" ACTION="$PATH_INFO$" ENCTYPE="multipart/form-data">
<cond expr="$proc$">
<!-- Valeur par defaut -->
<set name="NposX" value="0">
<set name="NposY" value="0">
</cond>
<table cellpadding="4" cellspacing="4">
<tr>
<td>Image 1 : </td>
<td>
<input TYPE="file" NAME="Fimg1" SIZE="20"><cond expr="!$Path_img1$">$Path_img1$</cond>
<input type="hidden" name="Path_img1" value="$Path_img1$">
</td>
</tr>
<tr>
<td>Largeur : </td>
<td>
<input type="text" id="Nwidth" name="Nwidth" value="$Nwidth$">
</td>
</tr>
<tr>
<td>Hauteur : </td>
<td>
<input type="text" name="Nheight" value="$Nheight$">
</td>
</tr>
<tr>
<td>Image 2 : </td>
<td>
<input TYPE="file" NAME="Fimg2" SIZE="20"><cond expr="!$Path_img2$">$Path_img2$</cond>
<input type="hidden" name="Path_img2" value="$Path_img2$">
</td>
</tr>
<tr>
<td>Utiliser image 2 : </td>
<td>
<input type="radio" name="doUtil" value="doCopy">Copier
<input type="radio" name="doUtil" value="doColor">Texture
<td>
</tr>
<tr>
<td>Rectangle : </td>
<td>
X1 = <input type="text" name="NposX" value="$NposX$">
y1 = <input type="text" name="NposY" value="$NposY$">
X2 = <input type="text" name="NposX2" value="$NposX2$">
y2 = <input type="text" name="NposY2" value="$NposY2$">
</td>
</tr>
<tr>
<td>Tourner de: </td>
<td>
<input type="text" name="Nrotate" value="$Nrotate$">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input TYPE="submit" NAME="bt" VALUE="Valider">
</td>
</tr>
</table>
<input type="hidden" name="proc" value="exec">
</form>
<cond expr="$proc$=exec">
<table><tr>
<cond expr="!$Path_img1$">
<td>
<img src="$Path_img1$"><br>
$W1$x$H1$
</td>
<td>
<img src="$Path_img1$" width="$Nwidth$" height="$Nheight$"><br>
IMG SIZE par le navigateur
</td>
</cond>
<cond expr="!$img1$">
<td>
<pict name="img1" width="$Nwidth$" height="$Nheight$" >
<pict name="img1" dest="$fileDir$/resize.jpg">
<img SRC="$fileDir$/resize.jpg"><br>
Resize image ($Nwidth$x$Nheight$)
</td>
<else expr="!$Path_img1$">
<td>
<pict path="$Path_img1$" dest="$fileDir$/resize.jpg" width="$Nwidth$" height="$Nheight$">
<img SRC="$fileDir$/resize.jpg"><br>
Direct resize ($Nwidth$x$Nheight$)
</td>
</cond>
</tr></table>
<cond expr="!$Path_img2$">
<h2>CREATION IMAGE</h2>
<img src="$Path_img2$">
<cond expr="$Nrotate$!=0 AND !$Nrotate$">
<pict name="img2" rotate="$Nrotate$">
</cond>
<cond expr="$doUtil$=doCopy">
<pict name="img1" copy="img2" x="$NposX$" y="$NposY$">
Copy à la position $NposX$,$NposY$<br>
<else expr="$doUtil$=doColor">
<cond expr="!$NposX2$ AND !$NposY2$">
<pict name="img1" rect="$NposX$,$NposY$,$NposX2$,$NposY2$" fill="$Path_img2$">
Rempli à le rectangle $NposX$,$NposY$,$NposX2$,$NposY2$<br>
<else>
<pict name="img1" x="$NposX$" y="$NposY$" fill="$Path_img2$">
Rempli à la position $NposX$,$NposY$<br>
</cond>
</cond>
<pict name="img1" dest="$fileDir$/pictmod.jpg">
<img src="$fileDir$/pictmod.jpg">
</cond>
<pict close="img1">
<pict close="img2">
</cond>
</font>
</body>
</html>
20240504