Пример #1
0
        public virtual void OnPartialRenderFinished(RenderFinishedEventArgs e)
        {
            Action <RenderFinishedEventArgs> handler = PartialRenderFinished;

            if (handler != null)
            {
                handler(e);
            }
        }
Пример #2
0
        protected virtual void OnRenderFinished(RenderFinishedEventArgs e)
        {
            Action <RenderFinishedEventArgs> handler = RenderFinished;

            if (handler != null)
            {
                handler(e);
            }
        }
Пример #3
0
        protected virtual void OnPreRender()
        {
            var result  = Canvas.OnPreRender();
            var handler = PreRender;
            var args    = new RenderFinishedEventArgs();

            args.TotalWidth   = 0;
            args.TotalHeight  = 0;
            args.Width        = 0;
            args.Height       = 0;
            args.RenderResult = result;

            if (handler != null)
            {
                handler(args);
            }
        }
Пример #4
0
 protected virtual void OnRenderFinished(RenderFinishedEventArgs e)
 {
     RoutedEventArgs newEventArgs = new RoutedEventArgs(RenderFinishedEvent);
     RaiseEvent(newEventArgs);
 }
Пример #5
0
 private void AddPartialResult(RenderFinishedEventArgs result)
 {
     lock (this)
     {
         Width = result.TotalWidth;
         Height = result.TotalHeight;
         var bitmap = (Bitmap)result.RenderResult;
         IntPtr hBitmap = bitmap.GetHbitmap();
         try
         {
             PartialResults.Add(Imaging.CreateBitmapSourceFromHBitmap(
                     hBitmap,
                     IntPtr.Zero, Int32Rect.Empty,
                     BitmapSizeOptions.FromWidthAndHeight(bitmap.Width, bitmap.Height)));
         }
         finally
         {
             DeleteObject(hBitmap);
         }
     }
 }
Пример #6
0
        private void DrawResult(RenderFinishedEventArgs result)
        {
            lock (this)
            {
                Width = result.TotalWidth;
                Height = result.TotalHeight;
                var bitmap = (Bitmap)result.RenderResult;
                IntPtr hBitmap = bitmap.GetHbitmap();
                try
                {
                  //  ImageSourceConverter c = new ImageSourceConverter();
                 //   var imgSOurce = (c.ConvertFrom(bitmap)) as ImageSource;

                 //   imagi.Source = imgSOurce;
                    var bitmapSource = Imaging.CreateBitmapSourceFromHBitmap(
                            hBitmap,
                            IntPtr.Zero, Int32Rect.Empty,
                            BitmapSizeOptions.FromWidthAndHeight(bitmap.Width, bitmap.Height));
                    imagi.Dispatcher.Invoke(() =>
                    {
                        imagi.Source = bitmapSource;
                    });
                    //PartialResults.Add(bitmapSource);
                }
                finally
                {
                    DeleteObject(hBitmap);
                }
            }
        }
Пример #7
0
 protected virtual void OnRenderFinished(RenderFinishedEventArgs e)
 {
 }
Пример #8
0
 private void AddPartialResult(RenderFinishedEventArgs result)
 {
     lock (this)
     {
         Width = (int)result.TotalWidth;
         Height = (int)result.TotalHeight;
         _images.Add((Image)result.RenderResult);
         Invalidate();
     }
 }
Пример #9
0
 protected virtual void OnRenderFinished(RenderFinishedEventArgs e)
 {
     EventHandler handler = RenderFinished;
     if (handler != null) handler(this, EventArgs.Empty);
 }
Пример #10
0
 private void _renderer_PartialRenderFinished(RenderFinishedEventArgs obj)
 {
     _diagramCanvasList.Add((Windows.UI.Xaml.Controls.Canvas)obj.RenderResult);
 }
Пример #11
0
        private void _renderer_RenderFinished(RenderFinishedEventArgs obj)
        {
            this.diagramContainer.Children.Clear();
            int canvasCount = 1;
            double lastY = 0;
            foreach (var canvas in _diagramCanvasList)
            {
                this.diagramContainer.Children.Add(canvas);

                canvasCount--;
                //if (canvasCount == 0) break; //TEMP
                lastY += canvas.Height;
            }
        }
Пример #12
0
 public virtual void OnPartialRenderFinished(RenderFinishedEventArgs e)
 {
     Action<RenderFinishedEventArgs> handler = PartialRenderFinished;
     if (handler != null) handler(e);
 }
Пример #13
0
 protected virtual void OnRenderFinished(RenderFinishedEventArgs e)
 {
     Action<RenderFinishedEventArgs> handler = RenderFinished;
     if (handler != null) handler(e);
 }
Пример #14
0
        private void AppendRenderResult(RenderFinishedEventArgs result)
        {
            CanvasElement.style.width = result.TotalWidth + "px";
            CanvasElement.style.height = result.TotalHeight + "px";

            if (result.RenderResult != null)
            {
                Node itemToAppend;
                if (@typeof(result.RenderResult) == "string")
                {
                    var partialResult = (HtmlDivElement)document.createElement("div");
                    partialResult.innerHTML = result.RenderResult.As<string>();
                    itemToAppend = partialResult.firstChild;
                }
                else
                {
                    itemToAppend = (Node)result.RenderResult;
                }
                CanvasElement.appendChild(itemToAppend);
            }
        }
Пример #15
0
 protected virtual void OnPartialRenderFinished(RenderFinishedEventArgs obj)
 {
     Action<RenderFinishedEventArgs> handler = PartialRenderFinished;
     if (handler != null) handler(obj);
 }