Exemplo n.º 1
0
 private void ImageRead(PipeRequest request, Pipe pipe)
 {
     if (Active)
     {
         _imageRequest = null;
         try
         {
             if (request.Result.IsNative)
             {
                 byte[] resultBytes = request.Result.AsByteArray;
                 SetImage(System.Drawing.Image.FromStream(new MemoryStream(resultBytes, 0, resultBytes.Length, false, true)));
             }
             else
             {
                 using (Stream stream = request.Result.OpenStream())
                 {
                     MemoryStream copyStream = new MemoryStream();
                     StreamUtility.CopyStream(stream, copyStream);
                     SetImage(System.Drawing.Image.FromStream(copyStream));
                 }
             }
         }
         catch
         {
             SetImage(ImageUtility.GetErrorImage());
         }
     }
 }
Exemplo n.º 2
0
 protected void ImageRead(PipeRequest request, Pipe pipe)
 {
     _imageRequest = null;
     try
     {
         if (request.Result.IsNative)
         {
             byte[] resultBytes = request.Result.AsByteArray;
             _image = System.Drawing.Image.FromStream(new MemoryStream(resultBytes, 0, resultBytes.Length, false, true));
         }
         else
         {
             using (Stream stream = request.Result.OpenStream())
             {
                 MemoryStream copyStream = new MemoryStream();
                 StreamUtility.CopyStream(stream, copyStream);
                 _image = System.Drawing.Image.FromStream(copyStream);
             }
         }
     }
     catch
     {
         _image = ImageUtility.GetErrorImage();
     }
     FCallBack(this, new EventArgs());
 }
Exemplo n.º 3
0
 protected void ImageRead(PipeRequest request, Pipe pipe)
 {
     _imageRequest = null;
     try
     {
         if (request.Result.IsNative)
         {
             _image = ImageUtility.BitmapImageFromBytes(request.Result.AsByteArray);
         }
         else
         {
             using (Stream stream = request.Result.OpenStream())
                 _image = ImageUtility.BitmapImageFromStream(stream);
         }
     }
     catch
     {
         _image = ImageUtility.GetErrorImage();
     }
     FCallBack(this, new EventArgs());
 }
Exemplo n.º 4
0
 private void ImageRead(PipeRequest request, Pipe pipe)
 {
     if (Active)
     {
         _imageRequest = null;
         try
         {
             if (request.Result.IsNative)
             {
                 SetImage(ImageUtility.BitmapImageFromBytes(request.Result.AsByteArray));
             }
             else
             {
                 using (Stream stream = request.Result.OpenStream())
                     SetImage(ImageUtility.BitmapImageFromStream(stream));
             }
         }
         catch
         {
             SetImage(ImageUtility.GetErrorImage());
         }
     }
 }
Exemplo n.º 5
0
 private void ImageError(PipeRequest request, Pipe pipe, Exception exception)
 {
     _imageRequest = null;
     SetImage(ImageUtility.GetErrorImage());
 }
Exemplo n.º 6
0
 protected void ImageError(PipeRequest request, Pipe pipe, Exception exception)
 {
     _imageRequest = null;
     _image        = ImageUtility.GetErrorImage();
     FCallBack(this, new EventArgs());
 }