Esempio n. 1
0
 public override void RemoveDrawing(IList <Rectangle> updates)
 {
     if (ShouldApplyDrawing && Applied)
     {
         ApplyInvertedDrawing(updates);
         if (saved != null)
         {
             this.BGI.PutImage(saved.Origin, saved, BGICanvas.WriteMode.Copy, updates);
             saved = null;
         }
         PopStyles();
         Applied = false;
     }
 }
Esempio n. 2
0
        public override void ApplyDrawing(IList <Rectangle> updates)
        {
            if (ShouldApplyDrawing && !Applied)
            {
                PushStyles();

                if (Command != null && !string.IsNullOrEmpty(this.Command.Text))
                {
                    // save region
                    var font     = this.BGI.LoadFont(this.BGI.GetFontType());
                    var fontSize = font.GetTextSize(this.Command.Text, this.BGI.GetTextDirection(), this.BGI.GetFontSize()) + 1;
                    saved = this.BGI.GetImage(new Rectangle(this.Command.Point, fontSize));
                }
                ApplyInvertedDrawing(updates);
                Applied = true;
            }
        }