本文整理汇总了C#中SchetsEditor.SchetsControl.Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C# SchetsControl.Invalidate方法的具体用法?C# SchetsControl.Invalidate怎么用?C# SchetsControl.Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SchetsEditor.SchetsControl
的用法示例。
在下文中一共展示了SchetsControl.Invalidate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MuisVast
public void MuisVast(SchetsControl s, Point p)
{
IElement element = s.Schets.GetElement(p);
if (p != null)
{
s.Schets.Elementen.Remove(element);
s.Schets.Vernieuw();
s.Invalidate();
}
}
示例2: MuisLos
public override void MuisLos(SchetsControl s, Point p)
{
for (int i = s.LayerList.Count - 1; i >= 0; i--)
{
if (s.LayerList[i].Item1.Collision(s, i, p))
{
s.LayerList.RemoveAt(i);
s.RefreshList();
s.Invalidate();
break;
}
}
}
示例3: MuisLos
public override void MuisLos(SchetsControl s, Point p)
{
base.MuisLos(s, p);
var buffer = s.Schets.buffer;
for (var i = buffer.Count - 1; i >= 0; i--)
{
var geometry = buffer[i];
if (geometry.Bevat(p))
{
buffer.RemoveAt(i);
s.Schets.Herteken();
s.Invalidate();
break;
}
}
}
示例4: MuisVast
public override void MuisVast(SchetsControl s, Point p)
{
for (int i = s.Schets.Vormen.Count - 1; i > 0; i--) // foreach werkt hier niet omdat we de dan de onderste krijgen die reageert: de achtergrond
{
PuntVorm vorm = s.Schets.Vormen[i];
if (vorm.Geklikt(p))
{
vorm.Kwast = new SolidBrush(s.PenKleur);
vorm.TekenPen = new Pen(s.PenKleur, vorm.Dikte);
if (vorm.VerzamelingNummer != 0)
{
var verzameling = s.Schets.Vormen.FindAll(puvorm => puvorm.VerzamelingNummer == vorm.VerzamelingNummer && puvorm.GetType() == vorm.GetType());
foreach (var gelinktevorm in verzameling)
{
gelinktevorm.Kwast = new SolidBrush(s.PenKleur);
gelinktevorm.TekenPen = new Pen(s.PenKleur, gelinktevorm.Dikte);
}
}
s.Invalidate();
break;
}
}
}
示例5: MuisLos
public override void MuisLos(SchetsControl s, Point p)
{
s.Schets.Vernieuw();
s.Invalidate();
}
示例6: MuisLos
public override void MuisLos(SchetsControl s, Point p)
{
RechthoekVorm vorm = new RechthoekVorm(kwast, startpunt, p, s.PenDikte);
s.Schets.Vormen.Add(vorm);
s.Invalidate();
}
示例7: eraseLayer
/// <summary>Erases the layer at the given position (if there is one)</summary>
/// <param name="s">The SchetsControl to erase the layer from</param>
/// <param name="p">The position of the layer that should be erased</param>
private void eraseLayer(SchetsControl s, Point p)
{
// Loop through the layers from top to bottom
for(int i = s.Schets.Layers.Count; i != 0; --i)
{
// Check if we found a layer at the given position
if(s.Schets.Layers[i-1].IsClicked(p))
{
s.CommitAction(new SchetsActionRemoveLayer(s.Schets.Layers[i - 1], i - 1));
s.Schets.Layers.RemoveAt(i - 1);
s.Invalidate();
return;
}
}
}
示例8: LetterVirtueel
//Variant die geen element toevoegt
public override void LetterVirtueel(SchetsControl s, char c)
{
if (c >= 32)
{
Graphics gr = s.MaakBitmapGraphics();
Font font = new Font("Tahoma", 40);
string tekst = c.ToString();
SizeF sz =
gr.MeasureString(tekst, font, this.startpunt, StringFormat.GenericTypographic);
gr.DrawString(tekst, font, kwast,
this.startpunt, StringFormat.GenericTypographic);
// gr.DrawRectangle(Pens.Black, startpunt.X, startpunt.Y, sz.Width, sz.Height);
startpunt.X += (int)sz.Width;
s.Invalidate();
}
}
示例9: Letter
public override void Letter(SchetsControl s, char c)
{
if (char.IsControl(c)) return;
var letter = new Letter(kleur, startpunt, c);
s.Schets.Toevoegen(letter);
s.Invalidate();
startpunt.X += letter.box.Width;
}
示例10: ToolChange
// Make sure that if we are editting a layer, the layer is always added to the Schets
// and that its Editting property is set to false when changing tools
public override void ToolChange(SchetsControl s)
{
if(edittingLayer != null)
{
((LayerText)edittingLayer).Editting = false;
s.CommitAction(new SchetsActionAddLayer(edittingLayer));
s.Invalidate();
}
}
示例11: Bezig
/// <summary>Called when the tool is busy drawing the layer</summary>
/// <param name="s">The SchetsControl that the layer should be added to</param>
/// <param name="p1">The first point/location of the layer</param>
/// <param name="p2">The second point/location of the layer</param>
public virtual void Bezig(SchetsControl s, Point p1, Point p2)
{
if(edittingLayer == null)
s.Schets.Layers.Add(edittingLayer = CreateLayer(p1, p2));
else
((LayerTwoPoint) edittingLayer).SecondLocation = p2;
s.Invalidate();
}
示例12: MuisVast
public override void MuisVast(SchetsControl s, Point p)
{
if(edittingLayer != null)
{
((LayerText) edittingLayer).Editting = false;
s.CommitAction(new SchetsActionAddLayer(edittingLayer));
s.Invalidate();
}
base.MuisVast(s, p);
}
示例13: Letter
public override void Letter(SchetsControl s, char c)
{
if (c >= 32)
{
// If we're editting a layer, add the character to the layer
// if we're not editting a layer, we create a new text layer containing the character
if(edittingLayer == null)
{
s.Schets.Layers.Add(edittingLayer = new LayerText(this.startpunt, color, new String(c, 1)));
((LayerText) edittingLayer).Editting = true;
}
else
((LayerText) edittingLayer).Text += c;
s.Invalidate();
}
else if(c == '\b' && edittingLayer != null && ((LayerText) edittingLayer).Text.Length > 0)
{
// If the user pressed backspace
((LayerText)edittingLayer).Text = ((LayerText)edittingLayer).Text.Substring(0, ((LayerText)edittingLayer).Text.Length - 1);
s.Invalidate();
}
}
示例14: MuisDrag
public override void MuisDrag(SchetsControl s, Point p)
{
if(edittingLayer == null)
{
edittingLayer = new LayerPath(startpunt, penWidth, color);
((LayerPath) edittingLayer).Points.Add(p);
s.Schets.Layers.Add(edittingLayer);
}
else
((LayerPath) edittingLayer).Points.Add(p);
s.Invalidate();
}
示例15: MuisLos
public override void MuisLos(SchetsControl s, Point p)
{
base.MuisLos(s, p);
this.Compleet(s.MaakBitmapGraphics(), this.startpunt, p);
s.Invalidate();
}