DrawingMode
Namespace: Digi21.DigiNG
Assembly: Digi21.DigiNG.Plugin
Mode used by DigiNG.DrawEntity to draw an entity in the drawing window.
public enum DrawingMode
Values
| Value | Number | Description |
|---|---|---|
Draw |
0 | Draws the entity in its color. |
Hide |
1 | Erases the entity from the screen. The entity remains in the drawing file and becomes visible again on the next window regeneration. |
Xor |
2 | Draws the entity using XOR. Drawing the same entity twice with Xor restores the screen to its previous state. |
DrawEntity treats any value other than Draw or Hide as Xor.
Example
This command erases text from the active drawing file from the screen without deleting it from the file. Text becomes visible again on the next drawing window regeneration:
using Digi21.DigiNG;
using Digi21.DigiNG.Entities;
using Digi21.DigiNG.Plugin.Command;
namespace Ejemplos;
[Command(Name = "BORRA_TEXTOS_DE_PANTALLA")]
public class BorraTextosDePantalla : Command
{
public BorraTextosDePantalla()
{
Initialize += (sender, e) =>
{
var textos = DigiNG.DrawingFile
.OfType<ReadOnlyText>()
.Where(texto => !texto.Deleted)
.ToList<Entity>();
DigiNG.DrawEntity(textos, DrawingMode.Hide);
Dispose();
};
}
}