本文整理汇总了C#中SchetsEditor.SchetsControl类的典型用法代码示例。如果您正苦于以下问题:C# SchetsControl类的具体用法?C# SchetsControl怎么用?C# SchetsControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SchetsControl类属于SchetsEditor命名空间,在下文中一共展示了SchetsControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MuisVast
public override void MuisVast(SchetsControl s, Point p)
{
//Verwijder een element
s.acties.Gum(p);
//Redraw vanuit de acties
s.RedrawFromActions();
}
示例2: SchetsWin
public SchetsWin()
{
ISchetsTool[] deTools = { new PenTool(),
new LijnTool(),
new RechthoekTool(),
new VolRechthoekTool(),
new EllipseTool(),
new FilledEllipseTool(),
new TekstTool(),
new GumTool(),
new MoveTool() };
String[] deKleuren = { "Black", "White", "Red", "Green", "Blue"
, "Yellow", "Magenta", "Cyan", "Other"
};
this.ClientSize = new Size(780, 575);
huidigeTool = deTools[0];
schetscontrol = new SchetsControl();
schetscontrol.Location = new Point(64, 10);
schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
{
if(mea.Button != MouseButtons.Left) return;
vast = true;
huidigeTool.MuisVast(schetscontrol, mea.Location);
};
schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
{
if(vast)
huidigeTool.MuisDrag(schetscontrol, mea.Location);
};
schetscontrol.MouseUp += (object o, MouseEventArgs mea) =>
{
if(mea.Button != MouseButtons.Left)
{
if(!vast)
showContextMenu(mea.Location);
return;
}
vast = false;
huidigeTool.MuisLos(schetscontrol, mea.Location);
};
schetscontrol.KeyPress += (object o, KeyPressEventArgs kpea) =>
{
huidigeTool.Letter(schetscontrol, kpea.KeyChar);
};
this.Controls.Add(schetscontrol);
menuStrip = new MenuStrip();
menuStrip.Visible = false;
this.Controls.Add(menuStrip);
this.maakFileMenu();
this.maakToolMenu(deTools);
this.maakAktieMenu(deKleuren);
this.maakToolButtons(deTools);
this.maakAktieButtons(deKleuren);
this.Resize += this.veranderAfmeting;
this.veranderAfmeting(null, null);
this.FormClosing += SchetsWin_FormClosing;
}
示例3: SchetsWin
public SchetsWin()
{
ISchetsTool[] deTools = { new PenTool()
, new LijnTool()
, new RechthoekTool()
, new CirkelTool()
, new VolCirkelTool()
, new VolRechthoekTool()
, new TekstTool()
, new GumTool()
};
String[] deKleuren = { "Black", "Red", "Green", "Blue"
, "Yellow", "Magenta", "Cyan"
};
this.ClientSize = new Size(700, 549);
huidigeTool = deTools[0];
schetscontrol = new SchetsControl();
schetscontrol.Location = new Point(64, 10);
schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
{ veranderd = true; };
schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
{
vast = true;
huidigeTool.MuisVast(schetscontrol, mea.Location);
};
schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
{
if (vast)
huidigeTool.MuisDrag(schetscontrol, mea.Location);
};
schetscontrol.MouseUp += (object o, MouseEventArgs mea) =>
{
if (vast)
huidigeTool.MuisLos(schetscontrol, mea.Location);
vast = false;
};
schetscontrol.KeyPress += (object o, KeyPressEventArgs kpea) =>
{
huidigeTool.Letter(schetscontrol, kpea.KeyChar);
};
this.Controls.Add(schetscontrol);
menuStrip = new MenuStrip();
menuStrip.Visible = false;
this.Controls.Add(menuStrip);
this.maakFileMenu();
this.maakToolMenu(deTools);
this.maakActieMenu(deKleuren);
this.maakToolButtons(deTools);
this.maakActieButtons(deKleuren);
this.Resize += this.veranderAfmeting;
this.FormClosing += this.Afsluitvrager;
this.veranderAfmeting(null, null);
}
示例4: 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();
}
}
示例5: SchetsWin
public SchetsWin()
{
ISchetsTool[] deTools = { new PenTool()
, new LijnTool()
, new RechthoekTool()
, new VolRechthoekTool()
, new TekstTool()
, new GumTool()
, new OvaalTool()
, new VolOvaalTool()
, new VerplaatsTool()
};
this.ClientSize = new Size(750, 600);
huidigeTool = deTools[0];
schetscontrol = new SchetsControl();
schetscontrol.Location = new Point(109, 10);
schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
{
vast = true;
huidigeTool.MuisVast(schetscontrol, mea.Location);
};
schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
{
if (vast)
huidigeTool.MuisDrag(schetscontrol, mea.Location);
};
schetscontrol.MouseUp += (object o, MouseEventArgs mea) =>
{
if (vast)
huidigeTool.MuisLos(schetscontrol, mea.Location);
vast = false;
};
schetscontrol.KeyPress += (object o, KeyPressEventArgs kpea) =>
{
huidigeTool.Letter(schetscontrol, kpea.KeyChar);
};
this.Controls.Add(schetscontrol);
menuStrip = new MenuStrip();
menuStrip.Visible = false;
this.Controls.Add(menuStrip);
this.maakFileMenu();
this.maakToolMenu(deTools);
this.maakAktieMenu();
this.maakToolButtons(deTools);
this.maakAktieButtons();
this.Resize += this.veranderAfmeting;
this.veranderAfmeting(null, null);
}
示例6: Letter
public override void Letter(SchetsControl s, char c)
{
LetterElement letter;
if (c >= 32)
{
letter = new LetterElement(startpunt, kwast, c);
s.VoegElementToe(letter);
Graphics gr = s.MaakBitmapGraphics();
letter.teken(gr);
SizeF sz = letter.Grootte;
startpunt.X += (int)sz.Width;
}
}
示例7: SaveActies
public static void SaveActies(string filename, SchetsControl sc)
{
List<Element> e = sc.acties.Elementen;
using (StreamWriter s = new StreamWriter(filename))
{
s.WriteLine(sc.Schets.Bitmap.Size.Width.ToString() + "," + sc.Schets.Bitmap.Size.Height.ToString());
for (int i = 0; i < e.Count; i++)
{
//Element naar string converteren
s.WriteLine(e[i].ToString());
}
}
}
示例8: 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;
}
}
}
示例9: 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;
}
}
}
示例10: SchetsWin
public SchetsWin()
{
this.ClientSize = new Size(700, 600);
huidigeTool = deTools[0];
schetscontrol = new SchetsControl();
schetscontrol.Location = new Point(64, 10);
schetscontrol.MouseDown += (object o, MouseEventArgs mea) =>
{ vast=true;
huidigeTool.MuisVast(schetscontrol, mea.Location);
};
schetscontrol.MouseMove += (object o, MouseEventArgs mea) =>
{ if (vast)
huidigeTool.MuisDrag(schetscontrol, mea.Location);
};
schetscontrol.MouseUp += (object o, MouseEventArgs mea) =>
{ if (vast)
huidigeTool.MuisLos (schetscontrol, mea.Location);
vast = false;
};
schetscontrol.KeyPress += (object o, KeyPressEventArgs kpea) =>
{ huidigeTool.Letter (schetscontrol, kpea.KeyChar);
};
this.Controls.Add(schetscontrol);
menuStrip = new MenuStrip();
menuStrip.Visible = false;
this.Controls.Add(menuStrip);
this.maakFileMenu();
this.maakEditMenu();
this.maakToolMenu(deTools);
this.maakAktieMenu();
this.maakToolButtons(deTools);
this.maakAktieButtons();
this.Resize += this.veranderAfmeting;
this.veranderAfmeting(null, null);
}
示例11: Collision
public override bool Collision(SchetsControl s, int i, Point p)
{
double dx, dy, x0, y0, x1, y1, x2, y2, k;
x0 = s.LayerList[i].Item3.X;
y0 = s.LayerList[i].Item3.Y;
x1 = s.LayerList[i].Item4.X;
y1 = s.LayerList[i].Item4.Y;
x2 = p.X; y2 = p.Y;
dx = x1 - x0;
dy = y1 - y0;
k = ((x2 - x0) * dx + (y2 - y0) * dy) / (dx * dx + dy * dy);
if (k > 1)
{
k = 1;
}
else if (k < 0)
{
k = 0;
}
dx = (x0 + k * dx) - x2;
dy = (y0 + k * dy) - y2;
return dx * dx + dy * dy <= bound * bound * 4;
}
示例12: 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();
}
}
示例13: Letter
public override void Letter(SchetsControl s, char c)
{
this.LetterVirtueel(s, c);
if (c != ' ')
s.acties.AddChar(c);
}
示例14: MuisVirtueel
//Variant van de startfunctie die geen element toevoegd, voor het verborgen hertekenen
public void MuisVirtueel(SchetsControl s, Point p)
{
startpunt = p;
}
示例15: MuisLos
public virtual void MuisLos(SchetsControl s, Point p)
{
kwast = new SolidBrush(s.PenKleur);
}