All pastes #755946 Raw Edit

Stuff

public text v1 · immutable
#755946 ·published 2007-10-31 00:37 UTC
rendered paste body
   public void takeSnapshot(){
        try {  
            
            String w,h,wh;
//            wh = mmcMenu.beallitasok.get("resoltion");
            //w = wh.substring(0,wh.indexOf("x"));
            
  //          h = wh.substring(w.length()+1,wh.length());
            // "encoding=jpeg&width="+w+"&height="+h
           byteImage = vc.getSnapshot(null);
           //myImage = Image.createImage(byteImage, 0, byteImage.length);

           //myDisplay.setCurrent(myImageCanvas);

           //ClientSession sajt = new Connector().open();
           
           
           
    //statusField.setString("connecting");
    String adr = "btgoep://000FDE626096:4";
    //statusField.setString("adr " + adr);
    ClientSession cs = (ClientSession) Connector.open(adr);
   // statusField.setString("connected");
    HeaderSet hs = cs.createHeaderSet();
    cs.connect(hs);
    
    
    
    //statusField.setString("created header set " + hs.getResponseCode());
    //byte text[] = "Test Message from avetanaBlueooth".getBytes("iso-8859-1");
    hs.setHeader (HeaderSet.NAME, "ize.jpg");
    hs.setHeader (HeaderSet.TYPE, "image/jpeg");
    hs.setHeader(HeaderSet.LENGTH, new Long(byteImage.length));
    //hs.setHeader(0x49, text); // if everything fits inside a packet, the data can be packed in the PUT command
    //statusField.setString("putting");
    Operation po = cs.put(hs);
    //statusField.setString("put ");
    po.openOutputStream().write(byteImage);
    po.close();
    cs.disconnect(null);
    cs.close();
//   Operation putOperation = cs.put(hs);
//                
//                OutputStream outputStream = putOperation.openOutputStream();
//                outputStream.write(byteImage);
//                // file push complete
//                
//                outputStream.close();
//                putOperation.close();
//                
//                cs.disconnect(null);
//                cs.close();
//           
         }catch( Exception e ) {
          e.printStackTrace();
          }
        }