Exemple #1
0
        protected void DrawBackground(IDrawingToolkit tk)
        {
            tk.FillColor = BackgroundColor;
            tk.DrawRectangle(Position, Width, Height);

            if (Active && BackgroundImageActive != null)
            {
                tk.DrawImage(Position, Width, Height, BackgroundImageActive,
                             ScaleMode.AspectFit);
            }
            else if (Insensitive && BackgroundImageInsensitive != null)
            {
                tk.DrawImage(Position, Width, Height, BackgroundImageInsensitive,
                             ScaleMode.AspectFit);
            }
            else if (Highlighted && BackgroundImageHighlighted != null)
            {
                tk.DrawImage(Position, Width, Height, BackgroundImageHighlighted,
                             ScaleMode.AspectFit);
            }
            else if (BackgroundImage != null)
            {
                tk.DrawImage(Position, Width, Height, BackgroundImage,
                             ScaleMode.AspectFit);
            }
        }
Exemple #2
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            if (!Visible)
            {
                return;
            }
            if (Position == null || ViewModel == null)
            {
                return;
            }

            if (!modified)
            {
                tk.DrawImage(Position - new Point(missingLocationPinImage.Width / 2, missingLocationPinImage.Height / 2),
                             missingLocationPinImage.Width, missingLocationPinImage.Height,
                             missingLocationPinImage, ScaleMode.AspectFit);
            }
            else
            {
                if (moving)
                {
                    Point p = Position - new Point(locationPinImageMoving.Width / 2, locationPinImageMoving.Height);
                    p.Y += locationPinImageSet.Height / 2;
                    tk.DrawImage(p,
                                 locationPinImageMoving.Width, locationPinImageMoving.Height,
                                 locationPinImageMoving, ScaleMode.AspectFit);
                }
                else
                {
                    tk.DrawImage(Position - new Point(locationPinImageSet.Width / 2, locationPinImageSet.Height / 2),
                                 locationPinImageSet.Width, locationPinImageSet.Height,
                                 locationPinImageSet, ScaleMode.AspectFit);
                }
            }
        }
Exemple #3
0
        protected static Image RenderFrameDrawing(IDrawingToolkit tk, Area area, FrameDrawing fd, Image image)
        {
            Image    img;
            ISurface surface;

            Log.Debug("Rendering frame drawing with ROI: " + area);
            surface = tk.CreateSurface((int)area.Width, (int)area.Height);
            using (IContext c = surface.Context) {
                tk.Context = c;
                tk.TranslateAndScale(new Point(-area.Start.X, -area.Start.Y), new Point(1, 1));
                tk.DrawImage(image);
                foreach (Drawable d in fd.Drawables)
                {
                    ICanvasSelectableObject obj = CanvasFromDrawableObject(d);
                    obj.Draw(tk, null);
                    obj.Dispose();
                }
                if (fd.Freehand != null)
                {
                    tk.DrawImage(fd.Freehand);
                }
            }
            img = surface.Copy();
            surface.Dispose();
            return(img);
        }
Exemple #4
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            if (!UpdateDrawArea(tk, area, Area))
            {
                return;
            }

            base.Draw(tk, area);

            tk.Begin();

            cancelRect = new Rectangle(
                new Point((Position.X + Width) - StyleConf.ButtonRecWidth, Position.Y),
                StyleConf.ButtonRecWidth, HeaderHeight);

            if (Active && Mode != DashboardMode.Edit)
            {
                tk.LineWidth     = StyleConf.ButtonLineWidth;
                tk.StrokeColor   = Button.BackgroundColor;
                tk.FillColor     = Button.BackgroundColor;
                tk.FontWeight    = FontWeight.Normal;
                tk.FontSize      = StyleConf.ButtonHeaderFontSize;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText(new Point(Position.X + TextHeaderX, Position.Y),
                            Button.Width - TextHeaderX, iconImage.Height, Button.Timer.Name);
                tk.FontWeight    = FontWeight.Bold;
                tk.FontSize      = StyleConf.ButtonTimerFontSize;
                tk.FontAlignment = FontAlignment.Center;
                tk.DrawText(new Point(Position.X, Position.Y + iconImage.Height),
                            Button.Width, Button.Height - iconImage.Height,
                            PartialTime.ToSecondsString(), false, true);

                tk.FillColor = tk.StrokeColor = BackgroundColor;
                tk.DrawRectangle(cancelRect.TopLeft, cancelRect.Width, cancelRect.Height);
                tk.StrokeColor = TextColor;
                tk.FillColor   = TextColor;
                tk.DrawImage(new Point(cancelRect.TopLeft.X, cancelRect.TopLeft.Y + 5),
                             cancelRect.Width, cancelRect.Height - 10, cancelImage, true, true);
            }
            else
            {
                Text = Button.Name;
                DrawText(tk);
                Text = null;
            }

            if (TeamImage != null)
            {
                tk.DrawImage(new Point(Position.X + Width - 40, Position.Y + 5), 40,
                             iconImage.Height, TeamImage, true);
            }
            tk.End();
        }
Exemple #5
0
        protected void DrawImage(IDrawingToolkit tk)
        {
            Point pos = new Point(Position.X + BORDER_SIZE / 2, Position.Y + BORDER_SIZE / 2);

            if (Active && BackgroundImageActive != null)
            {
                tk.DrawImage(pos, Width - BORDER_SIZE, Height - BORDER_SIZE, BackgroundImageActive, true);
            }
            else if (BackgroundImage != null)
            {
                tk.DrawImage(pos, Width - BORDER_SIZE, Height - BORDER_SIZE, BackgroundImage, true);
            }
        }
Exemple #6
0
        protected void DrawImage(IDrawingToolkit tk)
        {
            Point pos = new Point(Position.X + BORDER_SIZE / 2, Position.Y + BORDER_SIZE / 2);

            tk.FillColor = MaskColor;
            if (Active && BackgroundImageActive != null)
            {
                tk.DrawImage(pos, Width - BORDER_SIZE, Height - BORDER_SIZE, BackgroundImageActive,
                             ScaleMode.AspectFit, MaskColor != null);
            }
            else if (BackgroundImage != null)
            {
                tk.DrawImage(pos, Width - BORDER_SIZE, Height - BORDER_SIZE, BackgroundImage,
                             ScaleMode.AspectFit, MaskColor != null);
            }
        }
Exemple #7
0
 /// <summary>
 /// Draws the button.
 /// </summary>
 /// <param name="tk">Tk.</param>
 protected override void DrawButton(IDrawingToolkit tk)
 {
     if (!ShowTags)
     {
         base.DrawButton(tk);
     }
     else
     {
         tk.FillColor   = BackgroundColor;
         tk.StrokeColor = TextColor;
         tk.LineWidth   = 0;
         tk.DrawRectangle(Position, Width, Height);
         if (Active)
         {
             tk.FillColor = TextColor;
             tk.DrawRectangle(Position, Width, HeaderHeight);
         }
         if (Icon != null)
         {
             if (Active)
             {
                 tk.FillColor = BackgroundColor;
             }
             else
             {
                 tk.FillColor = TextColor;
             }
             tk.DrawImage(new Point(Position.X + 5, Position.Y + 5),
                          Sizes.ButtonHeaderWidth, Sizes.ButtonHeaderHeight, Icon, ScaleMode.AspectFit, true);
         }
     }
 }
Exemple #8
0
        protected void DrawButton(IDrawingToolkit tk)
        {
            Color front, back;

            if (Active)
            {
                tk.LineWidth = StyleConf.ButtonLineWidth;
                front        = BackgroundColor;
                back         = TextColor;
            }
            else
            {
                tk.LineWidth = 0;
                front        = TextColor;
                back         = BackgroundColor;
            }
            tk.FillColor   = back;
            tk.StrokeColor = front;
            tk.DrawRectangle(Position, Width, Height);
            if (Icon != null)
            {
                tk.FillColor = front;
                tk.DrawImage(new Point(Position.X + 5, Position.Y + 5),
                             Icon.Width, Icon.Height, Icon, false, true);
            }
        }
Exemple #9
0
        void DrawApplyButton(IDrawingToolkit tk)
        {
            Point  pos;
            double width, height;

            if (!ShowApplyButton || SelectedTags.Count == 0)
            {
                rects [applyRect] = null;
                return;
            }

            pos = new Point(Position.X + Width - StyleConf.ButtonRecWidth,
                            Position.Y);
            width        = StyleConf.ButtonRecWidth;
            height       = HeaderHeight;
            tk.FillColor = Config.Style.PaletteBackgroundDark;
            tk.LineWidth = 0;
            tk.DrawRectangle(pos, width, height);
            tk.StrokeColor = Color.Green1;
            tk.FillColor   = Color.Green1;
            tk.FontSize    = 12;
            applyRect.Update(pos, width, height);
            buttonsRects [applyRect] = applyButton;
            pos = new Point(pos.X, pos.Y + 5);
            tk.DrawImage(pos, width, height - 10, applyImage, true, true);
        }
Exemple #10
0
        /// <summary>
        /// Draws the button.
        /// </summary>
        /// <param name="tk">Tk.</param>
        protected virtual void DrawButton(IDrawingToolkit tk)
        {
            Color front, back;

            if (Active)
            {
                tk.LineWidth = Sizes.ButtonLineWidth;
                front        = BackgroundColor;
                back         = BorderColor;
            }
            else
            {
                tk.LineWidth = 0;
                front        = BorderColor;
                back         = BackgroundColor;
            }
            tk.FillColor   = back;
            tk.StrokeColor = front;
            tk.DrawRectangle(Position, Width, Height);
            if (Icon != null)
            {
                tk.FillColor = front;
                tk.DrawImage(new Point(Position.X + 5, Position.Y + 5),
                             Sizes.ButtonHeaderWidth, Sizes.ButtonHeaderHeight, Icon, ScaleMode.AspectFit, true);
            }
        }
Exemple #11
0
        void DrawEditButton(IDrawingToolkit tk)
        {
            Point  pos;
            Color  c;
            double width, height;

            if ((ButtonVM.Mode != DashboardMode.Edit || ShowLinks || !ViewModel.ShowSubcategories) && !Button.ShowSettingIcon)
            {
                return;
            }

            c      = App.Current.Style.ThemeBase;
            width  = Sizes.ButtonRecWidth;
            height = HeaderHeight;
            pos    = new Point(Position.X + Width - Sizes.ButtonRecWidth,
                               Position.Y + Height - height);
            tk.LineWidth   = 0;
            tk.FillColor   = new Color(c.R, c.G, c.B, 200);
            tk.StrokeColor = BackgroundColor;
            tk.DrawRectangle(pos, width, height);
            tk.StrokeColor = App.Current.Style.ColorAccentSuccess;
            tk.FillColor   = App.Current.Style.ColorAccentSuccess;
            tk.FontSize    = Sizes.ButtonButtonsFontSize;
            editRect.Update(pos, width, height);
            buttonsRects [editRect] = editbutton;
            pos = new Point(pos.X, pos.Y + 5);
            tk.DrawImage(pos, width, height - 10, editImage, ScaleMode.AspectFit, true);
        }
Exemple #12
0
        void DrawApplyButton(IDrawingToolkit tk)
        {
            Point  pos;
            double width, height;

            if (!ShowApplyButton || SelectedTags.Count == 0)
            {
                rects [applyRect] = null;
                return;
            }

            pos = new Point(Position.X + Width - Sizes.ButtonRecWidth,
                            Position.Y);
            width        = Sizes.ButtonRecWidth;
            height       = HeaderHeight;
            tk.FillColor = App.Current.Style.ThemeBase;
            tk.LineWidth = 0;
            tk.DrawRectangle(pos, width, height);
            tk.StrokeColor = App.Current.Style.ColorAccentSuccess;
            tk.FillColor   = App.Current.Style.ColorAccentSuccess;
            tk.FontSize    = 12;
            applyRect.Update(pos, width, height);
            buttonsRects [applyRect] = applyButton;
            pos = new Point(pos.X, pos.Y + 5);
            tk.DrawImage(pos, width, height - 10, applyImage, ScaleMode.AspectFit, true);
        }
Exemple #13
0
        protected override void Render(Gdk.Drawable window, Widget widget, Gdk.Rectangle backgroundArea,
                                       Gdk.Rectangle cellArea, Gdk.Rectangle exposeArea, CellRendererState flags)
        {
            IDrawingToolkit tk = App.Current.DrawingToolkit;

            using (IContext context = new CairoContext(window)) {
                cellWidth  = cellArea.Width;
                cellHeight = cellArea.Height;

                Point pos = new Point(cellArea.X + backgroundArea.Width / 2 - BUTTON_WIDTH / 2,
                                      cellArea.Y + Sizes.FilterTreeViewOnlyTopOffset);

                Point imagePos = new Point(pos.X + SPACING, pos.Y + Sizes.FilterTreeViewOnlyTopOffset);

                //Get the offset to properly calculate if needs tooltip or redraw
                offsetX = pos.X - backgroundArea.X;
                offsetY = pos.Y - backgroundArea.Y;

                tk.Context = context;
                tk.Begin();
                tk.StrokeColor = App.Current.Style.ThemeBase;
                tk.FillColor   = Color.Transparent;
                if (flags.HasFlag(CellRendererState.Prelit) && cursor.IsInsideArea(pos, BUTTON_WIDTH, BUTTON_HEIGHT))
                {
                    tk.StrokeColor = App.Current.Style.ColorPrimary;
                    tk.LineWidth   = LINE_WIDTH;
                }

                tk.DrawRectangle(pos, BUTTON_WIDTH, BUTTON_HEIGHT);
                tk.DrawImage(imagePos, BUTTON_WIDTH - (SPACING * 2), BUTTON_HEIGHT - (Sizes.FilterTreeViewOnlyTopOffset * 2), Icon, ScaleMode.AspectFit);
                tk.End();
                tk.Context = null;
            }
        }
Exemple #14
0
 new void DrawButton(IDrawingToolkit tk)
 {
     if (!ShowTags)
     {
         base.DrawButton(tk);
     }
     else
     {
         tk.FillColor   = BackgroundColor;
         tk.StrokeColor = TextColor;
         tk.LineWidth   = 0;
         tk.DrawRectangle(Position, Width, Height);
         if (Active)
         {
             tk.FillColor = TextColor;
             tk.DrawRectangle(Position, Width, HeaderHeight);
         }
         if (Icon != null)
         {
             if (Active)
             {
                 tk.FillColor = BackgroundColor;
             }
             else
             {
                 tk.FillColor = TextColor;
             }
             tk.DrawImage(new Point(Position.X + 5, Position.Y + 5),
                          Icon.Width, Icon.Height, Icon, false, true);
         }
     }
 }
Exemple #15
0
        static void RenderTeam(IDrawingToolkit tk, Team team, Point imagePoint)
        {
            var shield = team.Shield ?? App.Current.ResourcesLocator.LoadIcon(Icons.DefaultShield);

            tk.DrawImage(imagePoint, Sizes.ListImageWidth, Sizes.ListImageWidth, shield,
                         ScaleMode.AspectFit);
        }
Exemple #16
0
 public override void Draw(IDrawingToolkit tk, Area area)
 {
     tk.Begin();
     tk.TranslateAndScale(Position, new Point(1, 1));
     if (background != null)
     {
         tk.DrawImage(background);
     }
     if (HomePlayingPlayers != null)
     {
         foreach (PlayerObject po in HomePlayingPlayers)
         {
             po.Playing          = true;
             po.SubstitutionMode = SubstitutionMode;
             po.Size             = playerSize;
             po.Draw(tk, area);
         }
     }
     if (AwayPlayingPlayers != null)
     {
         foreach (PlayerObject po in AwayPlayingPlayers)
         {
             po.Playing          = true;
             po.SubstitutionMode = SubstitutionMode;
             po.Size             = playerSize;
             po.Draw(tk, area);
         }
     }
     tk.End();
 }
Exemple #17
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            if (ViewModel == null)
            {
                return;
            }

            double height = ViewModel.Height < 0.1f ? Height : ViewModel.Height;
            double width  = Width - ViewModel.LeftPadding - ViewModel.RightPadding;

            tk.Begin();

            double posX = Position.X + ViewModel.LeftPadding;
            double posY = Position.Y + ViewModel.TopPadding;

            double end;
            double totalX = ViewModel.Series.ViewModels.Sum(x => x.Elements);

            if (ViewModel.Background != null)
            {
                tk.DrawImage(Position, Width, Height, ViewModel.Background, ScaleMode.Fill);
            }

            foreach (var serie in ViewModel.Series.Where(x => x.Elements != 0))
            {
                tk.FillColor   = serie.Color;
                tk.StrokeColor = serie.Color;
                end            = (serie.Elements / totalX) * width;
                tk.DrawRectangle(new Point(posX, posY), end, height);
                posX += end;
            }

            tk.End();
        }
Exemple #18
0
        void DrawEditButton(IDrawingToolkit tk)
        {
            Point  pos;
            Color  c;
            double width, height;

            if (Mode != DashboardMode.Edit || ShowLinks || !Button.ShowSubcategories)
            {
                return;
            }

            c      = Config.Style.PaletteBackgroundDark;
            width  = StyleConf.ButtonRecWidth;
            height = HeaderHeight;
            pos    = new Point(Position.X + Width - StyleConf.ButtonRecWidth,
                               Position.Y + Height - height);
            tk.LineWidth   = 0;
            tk.FillColor   = new Color(c.R, c.G, c.B, 200);
            tk.StrokeColor = BackgroundColor;
            tk.DrawRectangle(pos, width, height);
            tk.StrokeColor = Color.Green1;
            tk.FillColor   = Color.Green1;
            tk.FontSize    = StyleConf.ButtonButtonsFontSize;
            editRect.Update(pos, width, height);
            buttonsRects [editRect] = editbutton;
            pos = new Point(pos.X, pos.Y + 5);
            tk.DrawImage(pos, width, height - 10, editImage, true, true);
        }
Exemple #19
0
        public static void RenderSubstitution(Color color, Time evt, LMPlayer playerIn, LMPlayer playerOut, bool selected,
                                              bool isExpanded, IDrawingToolkit tk, IContext context, Area backgroundArea,
                                              Area cellArea, CellState state)
        {
            Point  selectPoint, textPoint, imagePoint, circlePoint;
            Point  inPoint, imgPoint, outPoint, timePoint;
            double textWidth;

            if (subsImage == null)
            {
                subsImage = App.Current.ResourcesLocator.LoadImage(StyleConf.SubsIcon);
            }
            tk.Context = context;
            tk.Begin();

            RenderTimelineEventBase(color, null, selected, null, tk, context, backgroundArea, cellArea, state,
                                    out selectPoint, out textPoint, out imagePoint, out circlePoint, out textWidth);
            inPoint  = textPoint;
            imgPoint = new Point(textPoint.X + StyleConf.ListImageWidth + StyleConf.ListRowSeparator, textPoint.Y);
            outPoint = new Point(imgPoint.X + 20 + StyleConf.ListRowSeparator, imgPoint.Y);
            RenderPlayer(tk, playerIn, inPoint);
            tk.DrawImage(imgPoint, 20, cellArea.Height, subsImage, ScaleMode.AspectFit);
            RenderPlayer(tk, playerOut, outPoint);

            timePoint        = new Point(outPoint.X + StyleConf.ListImageWidth + StyleConf.ListRowSeparator, textPoint.Y);
            tk.FontSize      = 10;
            tk.FontWeight    = FontWeight.Normal;
            tk.StrokeColor   = App.Current.Style.PaletteSelected;
            tk.FontAlignment = FontAlignment.Left;
            tk.DrawText(timePoint, 100, cellArea.Height, evt.ToSecondsString());
            RenderSeparationLine(tk, context, backgroundArea);
            tk.End();
        }
Exemple #20
0
 protected void RenderImage(IDrawingToolkit tk, Point p, VAS.Core.Common.Image image,
                            double width, double height)
 {
     if (image != null)
     {
         tk.DrawImage(p, width, height, image, ScaleMode.AspectFit);
     }
 }
Exemple #21
0
 protected void DrawIcon(IDrawingToolkit tk)
 {
     if (Icon != null)
     {
         tk.DrawImage(new Point(Position.X + (Width - IconWidth) / 2, Position.Y + (Height - IconHeight) / 2),
                      IconWidth, IconHeight, Icon, ScaleMode.AspectFit);
     }
 }
Exemple #22
0
        void DrawTeamShield(Image shield)
        {
            var point = new Point(pos.X, pos.Y + ((cellArea.Height - shield.Height) / 2));

            tk.DrawImage(point, shield.Width, shield.Height, shield, ScaleMode.AspectFit);
            pos             = new Point(pos.X + shield.Width, pos.Y);
            remainingWidth -= shield.Width;
        }
        void DrawTeamShield(Image shield, Color maskColor)
        {
            var point = new Point(pos.X, pos.Y + ((cellArea.Height - shield.Height) / 2));

            tk.FillColor = maskColor;
            tk.DrawImage(point, shield.Width, shield.Height, shield, ScaleMode.AspectFit, maskColor != null);
            pos             = new Point(pos.X + shield.Width, pos.Y);
            remainingWidth -= shield.Width;
        }
Exemple #24
0
        static void RenderTimelineEventBase(Color color, Image ss, bool selected, string desc, IDrawingToolkit tk,
                                            IContext context, Area backgroundArea, Area cellArea, CellState state,
                                            out Point selectPoint, out Point textPoint, out Point imagePoint,
                                            out Point circlePoint, out double textWidth)
        {
            selectPoint = new Point(backgroundArea.Start.X, backgroundArea.Start.Y);
            textPoint   = new Point(selectPoint.X + Sizes.ListSelectedWidth + Sizes.ListRowSeparator, selectPoint.Y);
            imagePoint  = new Point(textPoint.X + Sizes.ListTextWidth + Sizes.ListRowSeparator, selectPoint.Y);
            textWidth   = Sizes.ListTextWidth;
            circlePoint = new Point(selectPoint.X + Sizes.ListSelectedWidth / 2, selectPoint.Y + backgroundArea.Height / 2);

            tk.LineWidth = 0;
            if (state.HasFlag(CellState.Prelit))
            {
                tk.FillColor = App.Current.Style.ThemeContrastSecondary;
            }
            else
            {
                tk.FillColor = App.Current.Style.ThemeBase;
            }
            tk.DrawRectangle(backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);
            /* Selection rectangle */
            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawRectangle(selectPoint, Sizes.ListSelectedWidth, backgroundArea.Height);
            tk.FillColor = App.Current.Style.ThemeBase;
            tk.DrawCircle(circlePoint, (Sizes.ListSelectedWidth / 2) - 1);
            if (state.HasFlag(CellState.Selected))
            {
                tk.FillColor = App.Current.Style.ScreenBase;
                tk.FillColor = App.Current.Style.ThemeContrastDisabled;
                tk.DrawCircle(circlePoint, (Sizes.ListSelectedWidth / 2) - 2);
            }

            if (desc != null)
            {
                tk.FontSize      = 10;
                tk.FontWeight    = FontWeight.Normal;
                tk.StrokeColor   = App.Current.Style.TextBase;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText(textPoint, textWidth, cellArea.Height, desc);
            }
            if (selected)
            {
                if (EyeSurface == null)
                {
                    EyeSurface = App.Current.DrawingToolkit.CreateSurfaceFromIcon(Icons.ListEyePath, false);
                }
                tk.DrawSurface(new Point(imagePoint.X - EyeSurface.Width - Sizes.ListEyeIconOffset, imagePoint.Y + backgroundArea.Height / 2 - EyeSurface.Height / 2),
                               Sizes.ListEyeIconWidth, Sizes.ListEyeIconHeight, EyeSurface, ScaleMode.AspectFit);
            }
            if (ss != null)
            {
                tk.DrawImage(imagePoint, Sizes.ListImageWidth, cellArea.Height, ss,
                             ScaleMode.AspectFit);
            }
        }
Exemple #25
0
        /// <summary>
        /// Draws the timer.
        /// </summary>
        /// <param name="tk">Tk.</param>
        protected virtual void DrawTimer(IDrawingToolkit tk)
        {
            cancelRect = new Rectangle(
                new Point((Position.X + Width) - Sizes.ButtonRecWidth, Position.Y),
                Sizes.ButtonRecWidth, HeaderHeight);

            if (ViewModel.TimerTime != null && ButtonVM.Mode != DashboardMode.Edit)
            {
                tk.LineWidth     = Sizes.ButtonLineWidth;
                tk.StrokeColor   = Button.BackgroundColor;
                tk.FillColor     = Button.BackgroundColor;
                tk.FontWeight    = FontWeight.Normal;
                tk.FontSize      = Sizes.ButtonHeaderFontSize;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText(new Point(Position.X + TextHeaderX, Position.Y),
                            Button.Width - TextHeaderX, Sizes.ButtonHeaderHeight, ViewModel.Name);
                tk.FontWeight    = FontWeight.Bold;
                tk.FontSize      = Sizes.ButtonTimerFontSize;
                tk.FontAlignment = FontAlignment.Center;
                tk.DrawText(new Point(Position.X, Position.Y + Sizes.ButtonHeaderHeight),
                            Button.Width, Button.Height - Sizes.ButtonHeaderHeight,
                            ViewModel.TimerTime.ToSecondsString(), false, true);

                tk.FillColor = tk.StrokeColor = BackgroundColor;
                tk.DrawRectangle(cancelRect.TopLeft, cancelRect.Width, cancelRect.Height);
                tk.StrokeColor = TextColor;
                tk.FillColor   = TextColor;
                tk.DrawImage(new Point(cancelRect.TopLeft.X, cancelRect.TopLeft.Y + 5),
                             cancelRect.Width, cancelRect.Height - 10, cancelImage, ScaleMode.AspectFit, true);
            }
            else
            {
                Text = Button.Name;
                DrawText(tk);
                Text = null;
            }

            if (TeamImage != null)
            {
                tk.DrawImage(new Point(Position.X + Width - 40, Position.Y + 5), 40,
                             iconImage.Height, TeamImage, ScaleMode.AspectFit);
            }
        }
Exemple #26
0
        static void RenderTimelineEventBase(Color color, Image ss, bool selected, string desc, IDrawingToolkit tk,
                                            IContext context, Area backgroundArea, Area cellArea, CellState state,
                                            out Point selectPoint, out Point textPoint, out Point imagePoint,
                                            out Point circlePoint, out double textWidth)
        {
            selectPoint = new Point(backgroundArea.Start.X, backgroundArea.Start.Y);
            textPoint   = new Point(selectPoint.X + StyleConf.ListSelectedWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            imagePoint  = new Point(textPoint.X + StyleConf.ListTextWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            textWidth   = StyleConf.ListTextWidth;
            circlePoint = new Point(selectPoint.X + StyleConf.ListSelectedWidth / 2, selectPoint.Y + backgroundArea.Height / 2);

            tk.LineWidth = 0;
            if (state.HasFlag(CellState.Prelit))
            {
                tk.FillColor = Config.Style.PaletteBackgroundDarkBright;
            }
            else
            {
                tk.FillColor = Config.Style.PaletteBackgroundDark;
            }
            tk.DrawRectangle(backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);
            /* Selection rectangle */
            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawRectangle(selectPoint, StyleConf.ListSelectedWidth, backgroundArea.Height);
            tk.FillColor = Config.Style.PaletteBackgroundDark;
            tk.DrawCircle(circlePoint, (StyleConf.ListSelectedWidth / 2) - 1);
            if (state.HasFlag(CellState.Selected))
            {
                tk.FillColor = Config.Style.PaletteBackground;
                tk.FillColor = Config.Style.PaletteActive;
                tk.DrawCircle(circlePoint, (StyleConf.ListSelectedWidth / 2) - 2);
            }

            if (desc != null)
            {
                tk.FontSize      = 10;
                tk.FontWeight    = FontWeight.Normal;
                tk.StrokeColor   = Config.Style.PaletteSelected;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText(textPoint, textWidth, cellArea.Height, desc);
            }
            if (selected)
            {
                if (EyeSurface == null)
                {
                    EyeSurface = Config.DrawingToolkit.CreateSurface(Path.Combine(Config.IconsDir, StyleConf.ListEyeIconPath));
                }
                tk.DrawSurface(EyeSurface, new Point(imagePoint.X - EyeSurface.Width - StyleConf.ListEyeIconOffset, imagePoint.Y + backgroundArea.Height / 2 - EyeSurface.Height / 2));
            }
            if (ss != null)
            {
                tk.DrawImage(imagePoint, StyleConf.ListImageWidth, cellArea.Height, ss, true);
            }
        }
Exemple #27
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Point  zero, p;
            double size, scale;

            if (Player == null)
            {
                return;
            }

            zero  = new Point(0, 0);
            size  = Sizes.PlayerSize;
            scale = (double)Width / size;


            tk.Begin();
            tk.TranslateAndScale(Position, new Point(scale, scale));

            if (!UpdateDrawArea(tk, area, new Area(zero, size, size)))
            {
                tk.End();
                return;
            }

            /* Background */
            tk.FillColor = App.Current.Style.ThemeBase;
            tk.LineWidth = 0;
            tk.DrawRectangle(zero, Sizes.PlayerSize, Sizes.PlayerSize);

            /* Image */
            if (Player.Photo != null)
            {
                tk.DrawImage(zero, size, size, Player.Photo, ScaleMode.AspectFit);
            }
            else
            {
                tk.DrawSurface(zero, Sizes.PlayerSize, Sizes.PlayerSize, DefaultPhoto, ScaleMode.AspectFit);
            }

            /* Bottom line */
            p            = new Point(0, size - Sizes.PlayerLineWidth);
            tk.FillColor = Color;
            tk.DrawRectangle(p, size, 3);

            if (Player.Tagged)
            {
                Color c = Color.Copy();
                c.A          = (byte)(c.A * 60 / 100);
                tk.FillColor = c;
                tk.DrawRectangle(zero, size, size);
            }

            tk.End();
        }
Exemple #28
0
        protected virtual void DrawRecordButton(IDrawingToolkit tk)
        {
            Point  pos, bpos;
            double width, height;

            if (ViewModel.TagMode != TagMode.Free || ShowLinks)
            {
                return;
            }

            pos = new Point(Position.X + Width - Sizes.ButtonRecWidth,
                            Position.Y);
            bpos = new Point(pos.X, pos.Y + 5);

            width       = Sizes.ButtonRecWidth;
            height      = HeaderHeight;
            tk.FontSize = Sizes.ButtonButtonsFontSize;
            if (!Recording)
            {
                tk.FillColor   = App.Current.Style.ThemeBase;
                tk.StrokeColor = BackgroundColor;
                tk.LineWidth   = Sizes.ButtonLineWidth;
                tk.DrawRectangle(pos, width, height);
                tk.StrokeColor = App.Current.Style.ColorAccentError;
                tk.FillColor   = App.Current.Style.ColorAccentError;
                tk.DrawImage(bpos, width, height - 10, recImage, ScaleMode.AspectFit, true);
            }
            else
            {
                tk.FillColor = tk.StrokeColor = BackgroundColor;
                tk.DrawRectangle(pos, width, height);
                tk.StrokeColor = TextColor;
                tk.FillColor   = TextColor;
                tk.DrawImage(bpos, width, height - 10, cancelImage, ScaleMode.AspectFit, true);
                cancelRect.Update(pos, width, height);
                buttonsRects [cancelRect] = cancelButton;
            }
        }
Exemple #29
0
        void DrawRecordButton(IDrawingToolkit tk)
        {
            Point  pos, bpos;
            double width, height;

            if (Button.TagMode != TagMode.Free || ShowLinks)
            {
                return;
            }

            pos = new Point(Position.X + Width - StyleConf.ButtonRecWidth,
                            Position.Y);
            bpos = new Point(pos.X, pos.Y + 5);

            width       = StyleConf.ButtonRecWidth;
            height      = HeaderHeight;
            tk.FontSize = StyleConf.ButtonButtonsFontSize;
            if (!Recording)
            {
                tk.FillColor   = Config.Style.PaletteBackgroundDark;
                tk.StrokeColor = BackgroundColor;
                tk.LineWidth   = StyleConf.ButtonLineWidth;
                tk.DrawRectangle(pos, width, height);
                tk.StrokeColor = Color.Red1;
                tk.FillColor   = Color.Red1;
                tk.DrawImage(bpos, width, height - 10, recImage, true, true);
            }
            else
            {
                tk.FillColor = tk.StrokeColor = BackgroundColor;
                tk.DrawRectangle(pos, width, height);
                tk.StrokeColor = TextColor;
                tk.FillColor   = TextColor;
                tk.DrawImage(bpos, width, height - 10, cancelImage, true, true);
                cancelRect.Update(pos, width, height);
                buttonsRects [cancelRect] = cancelButton;
            }
        }
        public static void RenderSubstitution(Color color, Time evt, Player playerIn, Player playerOut, bool selected,
		                                       bool isExpanded, IDrawingToolkit tk, IContext context, Area backgroundArea,
		                                       Area cellArea, CellState state)
        {
            Point selectPoint, textPoint, imagePoint, circlePoint;
            Point inPoint, imgPoint, outPoint, timePoint;
            double textWidth;

            if (subsImage == null) {
                subsImage = new Image (Path.Combine (Config.IconsDir, StyleConf.SubsIcon));
            }
            tk.Context = context;
            tk.Begin ();

            RenderTimelineEventBase (color, null, selected, null, tk, context, backgroundArea, cellArea, state,
                out selectPoint, out textPoint, out imagePoint, out circlePoint, out textWidth);
            inPoint = textPoint;
            imgPoint = new Point (textPoint.X + StyleConf.ListImageWidth + StyleConf.ListRowSeparator, textPoint.Y);
            outPoint = new Point (imgPoint.X + 20 + StyleConf.ListRowSeparator, imgPoint.Y);
            RenderPlayer (tk, playerIn, inPoint);
            tk.DrawImage (imgPoint, 20, cellArea.Height, subsImage, true);
            RenderPlayer (tk, playerOut, outPoint);

            timePoint = new Point (outPoint.X + StyleConf.ListImageWidth + StyleConf.ListRowSeparator, textPoint.Y);
            tk.FontSize = 10;
            tk.FontWeight = FontWeight.Normal;
            tk.StrokeColor = Config.Style.PaletteSelected;
            tk.FontAlignment = FontAlignment.Left;
            tk.DrawText (timePoint, 100, cellArea.Height, evt.ToSecondsString ());
            RenderSeparationLine (tk, context, backgroundArea);
            tk.End ();
        }
Exemple #31
0
        protected void DrawButton(IDrawingToolkit tk)
        {
            Color front, back;

            if (Active) {
                tk.LineWidth = StyleConf.ButtonLineWidth;
                front = BackgroundColor;
                back = TextColor;
            } else {
                tk.LineWidth = 0;
                front = TextColor;
                back = BackgroundColor;
            }
            tk.FillColor = back;
            tk.StrokeColor = front;
            tk.DrawRectangle (Position, Width, Height);
            if (Icon != null) {
                tk.FillColor = front;
                tk.DrawImage (new Point (Position.X + 5, Position.Y + 5),
                    Icon.Width, Icon.Height, Icon, false, true);
            }
        }
Exemple #32
0
        protected void DrawImage(IDrawingToolkit tk)
        {
            Point pos = new Point (Position.X + BORDER_SIZE / 2, Position.Y + BORDER_SIZE / 2);

            if (Active && BackgroundImageActive != null) {
                tk.DrawImage (pos, Width - BORDER_SIZE, Height - BORDER_SIZE, BackgroundImageActive, true);
            } else if (BackgroundImage != null) {
                tk.DrawImage (pos, Width - BORDER_SIZE, Height - BORDER_SIZE, BackgroundImage, true);
            }
        }
Exemple #33
0
        void DrawEditButton(IDrawingToolkit tk)
        {
            Point pos;
            Color c;
            double width, height;

            if (Mode != DashboardMode.Edit || ShowLinks || !Button.ShowSubcategories) {
                return;
            }

            c = Config.Style.PaletteBackgroundDark;
            width = StyleConf.ButtonRecWidth;
            height = HeaderHeight;
            pos = new Point (Position.X + Width - StyleConf.ButtonRecWidth,
                Position.Y + Height - height);
            tk.LineWidth = 0;
            tk.FillColor = new Color (c.R, c.G, c.B, 200);
            tk.StrokeColor = BackgroundColor;
            tk.DrawRectangle (pos, width, height);
            tk.StrokeColor = Color.Green1;
            tk.FillColor = Color.Green1;
            tk.FontSize = StyleConf.ButtonButtonsFontSize;
            editRect.Update (pos, width, height);
            buttonsRects [editRect] = editbutton;
            pos = new Point (pos.X, pos.Y + 5);
            tk.DrawImage (pos, width, height - 10, editImage, true, true);
        }
 static void RenderTeam(IDrawingToolkit tk, VAS.Core.Store.Templates.Team team, Point imagePoint)
 {
     tk.DrawImage (imagePoint, StyleConf.ListImageWidth, StyleConf.ListImageWidth, team.Shield,
         ScaleMode.AspectFit);
 }
Exemple #35
0
        void DrawApplyButton(IDrawingToolkit tk)
        {
            Point pos;
            double width, height;

            if (!ShowApplyButton || SelectedTags.Count == 0) {
                rects [applyRect] = null;
                return;
            }

            pos = new Point (Position.X + Width - StyleConf.ButtonRecWidth,
                Position.Y);
            width = StyleConf.ButtonRecWidth;
            height = HeaderHeight;
            tk.FillColor = Config.Style.PaletteBackgroundDark;
            tk.LineWidth = 0;
            tk.DrawRectangle (pos, width, height);
            tk.StrokeColor = Color.Green1;
            tk.FillColor = Color.Green1;
            tk.FontSize = 12;
            applyRect.Update (pos, width, height);
            buttonsRects [applyRect] = applyButton;
            pos = new Point (pos.X, pos.Y + 5);
            tk.DrawImage (pos, width, height - 10, applyImage, true, true);
        }
Exemple #36
0
 new void DrawButton(IDrawingToolkit tk)
 {
     if (!ShowTags) {
         base.DrawButton (tk);
     } else {
         tk.FillColor = BackgroundColor;
         tk.StrokeColor = TextColor;
         tk.LineWidth = 0;
         tk.DrawRectangle (Position, Width, Height);
         if (Active) {
             tk.FillColor = TextColor;
             tk.DrawRectangle (Position, Width, HeaderHeight);
         }
         if (Icon != null) {
             if (Active) {
                 tk.FillColor = BackgroundColor;
             } else {
                 tk.FillColor = TextColor;
             }
             tk.DrawImage (new Point (Position.X + 5, Position.Y + 5),
                 Icon.Width, Icon.Height, Icon, false, true);
         }
     }
 }
        static void RenderTimelineEventBase(Color color, Image ss, bool selected, string desc, IDrawingToolkit tk,
		                                     IContext context, Area backgroundArea, Area cellArea, CellState state,
		                                     out Point selectPoint, out Point textPoint, out Point imagePoint,
		                                     out Point circlePoint, out double textWidth)
        {
            selectPoint = new Point (backgroundArea.Start.X, backgroundArea.Start.Y);
            textPoint = new Point (selectPoint.X + StyleConf.ListSelectedWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            imagePoint = new Point (textPoint.X + StyleConf.ListTextWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            textWidth = StyleConf.ListTextWidth;
            circlePoint = new Point (selectPoint.X + StyleConf.ListSelectedWidth / 2, selectPoint.Y + backgroundArea.Height / 2);

            tk.LineWidth = 0;
            if (state.HasFlag (CellState.Prelit)) {
                tk.FillColor = Config.Style.PaletteBackgroundDarkBright;
            } else {
                tk.FillColor = Config.Style.PaletteBackgroundDark;
            }
            tk.DrawRectangle (backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);
            /* Selection rectangle */
            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawRectangle (selectPoint, StyleConf.ListSelectedWidth, backgroundArea.Height);
            tk.FillColor = Config.Style.PaletteBackgroundDark;
            tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 1);
            if (state.HasFlag (CellState.Selected)) {
                tk.FillColor = Config.Style.PaletteBackground;
                tk.FillColor = Config.Style.PaletteActive;
                tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 2);
            }

            if (desc != null) {
                tk.FontSize = 10;
                tk.FontWeight = FontWeight.Normal;
                tk.StrokeColor = Config.Style.PaletteSelected;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText (textPoint, textWidth, cellArea.Height, desc);
            }
            if (selected) {
                if (EyeSurface == null) {
                    EyeSurface = Config.DrawingToolkit.CreateSurface (Path.Combine (Config.IconsDir, StyleConf.ListEyeIconPath));
                }
                tk.DrawSurface (EyeSurface, new Point (imagePoint.X - EyeSurface.Width - StyleConf.ListEyeIconOffset, imagePoint.Y + backgroundArea.Height / 2 - EyeSurface.Height / 2));
            }
            if (ss != null) {
                tk.DrawImage (imagePoint, StyleConf.ListImageWidth, cellArea.Height, ss, true);
            }
        }
Exemple #38
0
 static void RenderTeam(IDrawingToolkit tk, VAS.Core.Store.Templates.Team team, Point imagePoint)
 {
     tk.DrawImage(imagePoint, StyleConf.ListImageWidth, StyleConf.ListImageWidth, team.Shield,
                  ScaleMode.AspectFit);
 }
Exemple #39
0
        void DrawRecordButton(IDrawingToolkit tk)
        {
            Point pos, bpos;
            double width, height;

            if (Button.TagMode != TagMode.Free || ShowLinks) {
                return;
            }

            pos = new Point (Position.X + Width - StyleConf.ButtonRecWidth,
                Position.Y);
            bpos = new Point (pos.X, pos.Y + 5);

            width = StyleConf.ButtonRecWidth;
            height = HeaderHeight;
            tk.FontSize = StyleConf.ButtonButtonsFontSize;
            if (!Recording) {
                tk.FillColor = Config.Style.PaletteBackgroundDark;
                tk.StrokeColor = BackgroundColor;
                tk.LineWidth = StyleConf.ButtonLineWidth;
                tk.DrawRectangle (pos, width, height);
                tk.StrokeColor = Color.Red1;
                tk.FillColor = Color.Red1;
                tk.DrawImage (bpos, width, height - 10, recImage, true, true);
            } else {
                tk.FillColor = tk.StrokeColor = BackgroundColor;
                tk.DrawRectangle (pos, width, height);
                tk.StrokeColor = TextColor;
                tk.FillColor = TextColor;
                tk.DrawImage (bpos, width, height - 10, cancelImage, true, true);
                cancelRect.Update (pos, width, height);
                buttonsRects [cancelRect] = cancelButton;
            }
        }
Exemple #40
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            if (!UpdateDrawArea (tk, area, Area)) {
                return;
            }

            base.Draw (tk, area);

            tk.Begin ();

            cancelRect = new Rectangle (
                new Point ((Position.X + Width) - StyleConf.ButtonRecWidth, Position.Y),
                StyleConf.ButtonRecWidth, HeaderHeight);

            if (Active && Mode != DashboardMode.Edit) {
                tk.LineWidth = StyleConf.ButtonLineWidth;
                tk.StrokeColor = Button.BackgroundColor;
                tk.FillColor = Button.BackgroundColor;
                tk.FontWeight = FontWeight.Normal;
                tk.FontSize = StyleConf.ButtonHeaderFontSize;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText (new Point (Position.X + TextHeaderX, Position.Y),
                    Button.Width - TextHeaderX, iconImage.Height, Button.Timer.Name);
                tk.FontWeight = FontWeight.Bold;
                tk.FontSize = StyleConf.ButtonTimerFontSize;
                tk.FontAlignment = FontAlignment.Center;
                tk.DrawText (new Point (Position.X, Position.Y + iconImage.Height),
                    Button.Width, Button.Height - iconImage.Height,
                    PartialTime.ToSecondsString (), false, true);

                tk.FillColor = tk.StrokeColor = BackgroundColor;
                tk.DrawRectangle (cancelRect.TopLeft, cancelRect.Width, cancelRect.Height);
                tk.StrokeColor = TextColor;
                tk.FillColor = TextColor;
                tk.DrawImage (new Point (cancelRect.TopLeft.X, cancelRect.TopLeft.Y + 5),
                    cancelRect.Width, cancelRect.Height - 10, cancelImage, true, true);
            } else {
                Text = Button.Name;
                DrawText (tk);
                Text = null;
            }

            if (TeamImage != null) {
                tk.DrawImage (new Point (Position.X + Width - 40, Position.Y + 5), 40,
                    iconImage.Height, TeamImage, true);
            }
            tk.End ();
        }
Exemple #41
0
 public override void Draw(IDrawingToolkit tk, Area area)
 {
     tk.Begin ();
     tk.TranslateAndScale (Position, new Point (1, 1));
     if (background != null) {
         tk.DrawImage (background);
     }
     if (HomePlayingPlayers != null) {
         foreach (PlayerObject po in HomePlayingPlayers) {
             po.Playing = true;
             po.SubstitutionMode = SubstitutionMode;
             po.Size = playerSize;
             po.Draw (tk, area);
         }
     }
     if (AwayPlayingPlayers != null) {
         foreach (PlayerObject po in AwayPlayingPlayers) {
             po.Playing = true;
             po.SubstitutionMode = SubstitutionMode;
             po.Size = playerSize;
             po.Draw (tk, area);
         }
     }
     tk.End ();
 }
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Point zero, start, p;
            double size, scale;
            ISurface arrowin, arrowout;

            if (Player == null)
                return;

            zero = new Point (0, 0);
            size = StyleConf.PlayerSize;
            scale = (double)Width / size;

            if (Team == TeamType.LOCAL) {
                arrowin = ArrowIn;
                arrowout = ArrowOut;
            } else {
                arrowin = ArrowOut;
                arrowout = ArrowIn;
            }

            tk.Begin ();
            start = new Point (Size / 2, Size / 2);
            tk.TranslateAndScale (Center - start, new Point (scale, scale));

            if (!UpdateDrawArea (tk, area, new Area (zero, size, size))) {
                tk.End ();
                return;
            }

            /* Background */
            tk.FillColor = App.Current.Style.PaletteBackgroundDark;
            tk.LineWidth = 0;
            tk.DrawRectangle (zero, StyleConf.PlayerSize, StyleConf.PlayerSize);

            /* Image */
            if (Player.Photo != null) {
                tk.DrawImage (zero, size, size, Player.Photo, ScaleMode.AspectFit);
            } else {
                tk.DrawSurface (zero, StyleConf.PlayerSize, StyleConf.PlayerSize, PlayerObject.DefaultPhoto, ScaleMode.AspectFit);
            }

            /* Bottom line */
            p = new Point (0, size - StyleConf.PlayerLineWidth);
            tk.FillColor = Color;
            tk.DrawRectangle (p, size, 3);

            /* Draw Arrow */
            if (SubstitutionMode && (Highlighted || Active)) {
                ISurface arrow;
                Point ap;

                if (Playing) {
                    arrow = arrowout;
                } else {
                    arrow = arrowin;
                }
                ap = new Point (StyleConf.PlayerArrowX, StyleConf.PlayerArrowY);
                tk.DrawRectangle (ap, StyleConf.PlayerArrowSize, StyleConf.PlayerArrowSize);
                tk.DrawSurface (arrow, ap);
            }

            /* Draw number */
            p = new Point (StyleConf.PlayerNumberX, StyleConf.PlayerNumberY);
            tk.FillColor = Color;
            tk.DrawRectangle (p, StyleConf.PlayerNumberSize, StyleConf.PlayerNumberSize);

            tk.FillColor = Color.White;
            tk.StrokeColor = Color.White;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontWeight = FontWeight.Normal;
            if (Player.Number >= 100) {
                tk.FontSize = 12;
            } else {
                tk.FontSize = 16;
            }
            tk.DrawText (p, StyleConf.PlayerNumberSize, StyleConf.PlayerNumberSize,
                Player.Number.ToString ());

            if (Active) {
                Color c = Color.Copy ();
                c.A = (byte)(c.A * 60 / 100);
                tk.FillColor = c;
                tk.DrawRectangle (zero, size, size);
            }

            tk.End ();
        }
Exemple #43
0
        protected static Image RenderFrameDrawing(IDrawingToolkit tk, Area area, FrameDrawing fd, Image image)
        {
            Image img;
            ISurface surface;

            Log.Debug ("Rendering frame drawing with ROI: " + area);
            surface = tk.CreateSurface ((int)area.Width, (int)area.Height);
            using (IContext c = surface.Context) {
                tk.Context = c;
                tk.TranslateAndScale (new Point (-area.Start.X, -area.Start.Y), new Point (1, 1));
                tk.DrawImage (image);
                foreach (Drawable d in fd.Drawables) {
                    ICanvasSelectableObject obj = CanvasFromDrawableObject (d);
                    obj.Draw (tk, null);
                    obj.Dispose ();
                }
                tk.DrawImage (fd.Freehand);
            }
            img = surface.Copy ();
            surface.Dispose ();
            return img;
        }