You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by ab...@apache.org on 2004/06/10 15:59:06 UTC

cvs commit: jakarta-taglibs-sandbox/image/examples/web index.jsp

abey        2004/06/10 06:59:06

  Modified:    image/examples/web index.jsp
  Log:
  Added one more example working using the servlet context dir - Abey
  
  Revision  Changes    Path
  1.5       +49 -8     jakarta-taglibs-sandbox/image/examples/web/index.jsp
  
  Index: index.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/image/examples/web/index.jsp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- index.jsp	3 May 2004 15:47:42 -0000	1.4
  +++ index.jsp	10 Jun 2004 13:59:06 -0000	1.5
  @@ -11,7 +11,7 @@
   <h1 align="center">Image Tag examples</h1>
   <table width="100%" border="0" cellpadding="2">
     <tr align="center"> 
  -    <td colspan="3">A Tag example.</td>
  +    <td colspan="3"><h2>Example 1:</h2> <b>Saved within the context and accessed as a static image</b></td>
     </tr>
     <tr> 
       <td>&nbsp;</td>
  @@ -19,8 +19,35 @@
       
   <img:image src="/images/splash.jpg"
           dir="generated"
  +        name="splash-new-local.jpg"
  +	  attributes="border='0' alt='a sample dynamic image'">
  +    <img:text text="Saved within the context"
  +		x="10%" 
  +		y="75%" 
  +		font="Arial" 
  +		bold="true" 
  +		size="14" 
  +		color="0x0000ff"
  +	/>
  +</img:image>    
  +  
  +    </td>
  +    <td>&nbsp;</td>
  +  </tr>
  +
  +  <tr align="center"> 
  +    <td colspan="3"><hr/></td>
  +  </tr>
  +
  +  <tr align="center"> 
  +    <td colspan="3"><h2>Example 2:</h2> <b>Saved in the context temp dir and streamed by a servlet</b></td>
  +  </tr>
  +  <tr> 
  +    <td>&nbsp;</td>
  +    <td align="center">&nbsp;
  +    
  +<img:image src="/images/splash.jpg"
           name="splash-new-gray.jpg"
  -        refresh="true"
   	  attributes="border='0' alt='a sample dynamic image'">
       <img:grayscale/>
       <img:overlay x="55%" y="50%">
  @@ -33,6 +60,14 @@
       <img:border width="5" height="3" 
               color="0x005d00"/>
       <img:resize bestfit="true" width="200" height="400"/>
  +    <img:text text="Saved in the context temp dir"
  +		x="10%" 
  +		y="75%" 
  +		font="Arial" 
  +		bold="true" 
  +		size="12" 
  +		color="0xff0000"
  +	/>    
   </img:image>    
     
       </td>
  @@ -48,9 +83,7 @@
   		    it (GIF on JPEG). 
   		  <pre>
   &lt;img:image src=&quot;/images/splash.jpg&quot;
  -        dir=&quot;generated&quot;
           name=&quot;splash-new-gray.jpg&quot;
  -        refresh=&quot;true&quot;
           attributes=&quot;border='0' alt='a sample dynamic image'&quot;&gt;
       &lt;img:grayscale/&gt;
       &lt;img:overlay x=&quot;55%&quot; y=&quot;60%&quot;&gt;
  @@ -63,13 +96,21 @@
       &lt;img:border width=&quot;5&quot; height=&quot;3&quot; 
               color=&quot;0x005d00&quot;/&gt;
       &lt;img:resize bestfit=&quot;true&quot; width=&quot;200&quot; height=&quot;400&quot;/&gt;
  +    &lt;img:text text=&quot;Saved in the context temp dir&quot;
  +		x=&quot;10%&quot; 
  +		y=&quot;75%&quot; 
  +		font=&quot;Arial&quot; 
  +		bold=&quot;true&quot; 
  +		size=&quot;12&quot; 
  +		color=&quot;0xff0000&quot;
  +	/&gt;
   &lt;/img:image&gt;
   		</pre>		
   		The sequence of operations to generate the output image: -
   		<ol>
  -		  <li>The image file &quot;splash.jpg&quot; is loaded (each time since the &quot;refresh&quot; 
  -		    is set to &quot;true&quot;). Otherwise it checks for &quot;splash-new-gray.jpg&quot; 
  -		    in the &quot;generated&quot; directory and loads it. </li>
  +		  <li>The image file &quot;splash.jpg&quot; is loaded the first time this tag/ page is accessed
  +                (to load it each time the &quot;refresh&quot; must be set to &quot;true&quot;). 
  +                Otherwise it checks if &quot;splash-new-gray.jpg&quot; is in the context's temp directory. </li>
   		  <li>The image is converted to grayscale. </li>
   		  <li>The "new.gif" is overlaid/ painted on the base image at location 5% right 
   		    and 60% below (percentages of base image's current &quot;width&quot; and &quot;height&quot; 
  @@ -85,7 +126,7 @@
   		  <li>The image is saved as &quot;splash-new-gray.jpg&quot; in the &quot;generated&quot; 
   		  directory. </li>
   		  <li>An <code>&lt;img&gt;</code> tag similar to <code>&lt;img border='0' alt='a sample dynamic image' 
  -                src=&quot;/generated/splash-new-gray.jpg&quot; width=&quot;200&quot; height=&quot;132&quot;&gt;</code> 
  +                src=&quot;/image-examples/gen-image/splash-new-gray.jpg&quot; width=&quot;200&quot; height=&quot;132&quot;&gt;</code> 
                   is written. The &quot;width&quot; and &quot;height&quot; are that of the resulting image.</li>
   		</ol>
   		</blockquote>	
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org