示例#1
0
        public void MuisDrag(SchetsControl s, Point p)
        {
            int xDiff = huidigPunt.X - p.X;
            int yDiff = huidigPunt.Y - p.Y;

            if (geselecteerdObject is PenObject)
            {
                PenObject po = geselecteerdObject as PenObject;

                Stack <Point> newPunten = new Stack <Point>();
                foreach (Point oldP in po.Punten)
                {
                    newPunten.Push(new Point(oldP.X - xDiff, oldP.Y - yDiff));
                }
                po.Punten = newPunten;
            }
            else if (geselecteerdObject is TweePuntObject)
            {
                TweePuntObject tpo = geselecteerdObject as TweePuntObject;
                tpo.begin = new Point(tpo.begin.X - xDiff, tpo.begin.Y - yDiff);
                tpo.einde = new Point(tpo.einde.X - xDiff, tpo.einde.Y - yDiff);
            }
            else if (geselecteerdObject is TekstObject)
            {
                TekstObject to = geselecteerdObject as TekstObject;
                to.locatie = new Point(to.locatie.X - xDiff, to.locatie.Y - yDiff);
            }
            huidigPunt = p;
            s.Invalidate();
        }
示例#2
0
 public void MuisLos(SchetsControl s, Point p)
 {
     for (int n = 0; n < s.Schets.Historie.Count; n++)
     {
         ISchetsObject so = s.Schets.Historie[n];
         if (so.RaaktCirkel(p, 10))
         {
             int nummerVanOnderop = s.Schets.Historie.Count - n;
             s.Schets.Historie.Push(new GumObject(nummerVanOnderop));
             s.Invalidate();
             return;
         }
     }
 }
示例#3
0
        /// <summary>
        /// Tekent een afbeelding op het scherm
        /// </summary>
        /// <param name="s">De gewenste control om op te tekenen</param>
        /// <param name="location">De plaats van de afbeelding op de disk</param>
        public void DrawImage(SchetsControl s, string location)
        {
            image        = new DrawingObjects.Image();
            image.bitmap = new Bitmap(location);
            image.pointA = point;
            image.pointB = new Point(point.X + image.bitmap.Width, point.Y + image.bitmap.Height);
            image.path   = location;
            Graphics g = s.MaakBitmapGraphics();

            image.Draw(g, kwast);

            this.drawnItem.elements.Add(image);
            this.Finalize(s);
            s.Invalidate();
        }
示例#4
0
        public override void MuisVast(SchetsControl s, Point p)
        {
            base.MuisVast(s, p);

            // Ter verduidelijking wordt in eerste instantie een lijntje getekend om duidelijk te maken waar je gaat typen na te klikken.
            if (huidigTekstObject != null)
            {
                if (huidigTekstObject.tekst == lijntje)
                {
                    huidigTekstObject.tekst = string.Empty;
                }
                huidigTekstObject = null;
            }
            huidigTekstObject = new TekstObject(startpunt, s.PenDikte, s.PenKleur, lijntje);
            s.Schets.Historie.Push(huidigTekstObject);
            s.Invalidate();
        }
示例#5
0
 public override void Letter(SchetsControl s, char c)
 {
     huidigTekstObject.Letter(c);
     s.Invalidate();
 }
示例#6
0
 public override void MuisLos(SchetsControl s, Point p)
 {
     base.MuisLos(s, p);
     this.Compleet(s.CreateGraphics(), this.startpunt, p);
     s.Invalidate();
 }