Java Applet aDraw V 1.00

[ aDraw | tCalDate | tListe | tEuroCalc | tCalEvent | tChart | tFunction | tOnglet | tCChat | tCount ]
[ aTicker | aFont | aSearch | tBBar | tMButton tButton tScroll | tPassword | Winmine ]
[ Home | Applets | Servlets | ASP components ]

aDraw presentation


    Use applet save button or there javascript commands
  • Save in mycgiserver ...
  • Save in local (if jspImage is installed)...


  • In this sample you can see the use of the "Save" option by using a form and the javabeans JSP jspImage (it is possible to replace it by the ASP component acxImage for IIS servers). For it we use a Java => javascript communication (class JSobject).
    It is also possible to save the data without java <-> javascript communication (the applet Java can directly send data with a "POST").

    In this page I use jspImage component in an external site ( mycgiserver.com ) to build an image.

Sample JSP code to build image (save) :
<jsp:useBean id="zz" scope="session" class="javaside.Rbl.jspImage" /><%
     int    iW, iH ;	// Image size 
     String sFormat;	// Format (gif ou png) 
     String sData ;	// Data 

       sFormat = "png" ; 
       sData = request.getParameter("data") ; 

       String t = null ; 
       t = request.getParameter("w") ; 
       if (t == null) 
        iW = 380 ; 
       else
        iW = java.lang.Integer.parseInt(t) ; 

       t = request.getParameter("h") ; 
       if (t == null) 
        iH = 300 ; 
       else
        iH = java.lang.Integer.parseInt(t) ; 

      // Init image size
        zz.init(iW, iH) ; 
        zz.readData( sData ) ; 
        zz.build() ; 

        response.reset(); 
        response.setContentType("image/" + sFormat ); 
        response.addHeader("Content-Disposition","filename=jspImage." + sFormat); 


       if (sFormat.equalsIgnoreCase("png")) 
         response.getOutputStream().write(zz.getImage(1)); 
       else
         response.getOutputStream().write(zz.getImage(0)); 

        response.flushBuffer(); 

     zz.clear() ; 
 %>

Copyright © 1996..2002,
BERTHOU. All right reserved.
Last change : 02 Juillet 2002 18H16