Exemplo n.º 1
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.º 2
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());
         }
     }
 }