tutorials.de Buch-Aktion 05/2012
Seite 2 von 2 ErsteErste 12
ERLEDIGT
NEIN
ANTWORTEN
22
ZUGRIFFE
1679
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #16
    Avatar von Alexander12
    Alexander12 Alexander12 ist offline Mitglied Smaragd
    Registriert seit
    Jul 2005
    Ort
    Tutorials.de
    Beiträge
    1.143
    Hi Alex.

    Haha, es gibt auch für alles einen Link, was?

    Naja, auf jeden Fall habe Ich Mal rumprobiert und die Exe angehängt, Framework 1.1, speichern geht halt noch nicht. Es sit so ein Raumplaner geworden, kannst die Maße von nem quadratischen Raum eingeben und Linien zeichnen. Probiers mal!


    MfG Alexander12
    Angehängte Dateien Angehängte Dateien
     

  2. #17
    Avatar von Alexander Schuc
    Alexander Schuc Alexander Schuc ist offline admin | crazy-weasel
    tutorials.de Administrator
    Registriert seit
    Aug 2001
    Ort
    Österreich, Stmk, Graz
    Beiträge
    2.783
    Mh, du hängst auch alles mögliche hier an, oder?

    "Beta 1" finde ich mal wieder eine Spur übertrieben.
     
    With the first link the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably.
    Aaron Satie

    Legends... are the spice of the universe, Mr. Data, because they have a way of sometimes coming true.
    Captain Jean-Luc Picard, Stardate ~41294.5

    Tutorials.de chattet. Hier gibts auch .net Support ^^
    Klickt auf chattet und nutzt den Webchat, oder verbindet euch zu irc.tutorials.de - Channel #Tutorials.de

    (moo)blog furred.net // SiteInfo für WP7 // Pastebin für WP7 // BlogEngine.net Extensions

  3. #18
    Avatar von Alexander12
    Alexander12 Alexander12 ist offline Mitglied Smaragd
    Registriert seit
    Jul 2005
    Ort
    Tutorials.de
    Beiträge
    1.143
    Hi Alex.

    Hm.. Naja, Mal was Anhängen geht ja, oder?

    Naja, Ich finde aber das Ich mich vor rund 3 Stunden erst in GDI+ eingelesen habe ists gut, oder?


    MfG Alexander12
     

  4. #19
    Avatar von Alexander Schuc
    Alexander Schuc Alexander Schuc ist offline admin | crazy-weasel
    tutorials.de Administrator
    Registriert seit
    Aug 2001
    Ort
    Österreich, Stmk, Graz
    Beiträge
    2.783
    Hajo, lass ich mal gelten.
     
    With the first link the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably.
    Aaron Satie

    Legends... are the spice of the universe, Mr. Data, because they have a way of sometimes coming true.
    Captain Jean-Luc Picard, Stardate ~41294.5

    Tutorials.de chattet. Hier gibts auch .net Support ^^
    Klickt auf chattet und nutzt den Webchat, oder verbindet euch zu irc.tutorials.de - Channel #Tutorials.de

    (moo)blog furred.net // SiteInfo für WP7 // Pastebin für WP7 // BlogEngine.net Extensions

  5. #20
    Avatar von Alexander12
    Alexander12 Alexander12 ist offline Mitglied Smaragd
    Registriert seit
    Jul 2005
    Ort
    Tutorials.de
    Beiträge
    1.143
    Hi.

    Naja, dann kann Ich heute Nacht beruhigt schlafen.

    Morgen werde Ich mich Mal weiter in die GDI+ einlesen und dann noch Mal posten.


    Schönen Abend noch,
    Alexander12
     

  6. #21
    Avatar von Alexander12
    Alexander12 Alexander12 ist offline Mitglied Smaragd
    Registriert seit
    Jul 2005
    Ort
    Tutorials.de
    Beiträge
    1.143
    Hi.

    Ich versuche gerade erfolglos hinzubekommen, wie Ich eine Linie zeichne, während der Mausbutton gedrückt ist, also wie bei Paint, wo das ergebnis schon bei jeder Mausbewegung sichtbar ist und wenn Man den Mausbutton loslässt die Linie fixiert wird.

    Mein bisheriger Code, der nicht funktioniert:

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    public bool mouse = false;
    public int x1,y1,x2,y2;
            
    void MainFormMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
        if(mouse == false)
        {
            this.x1 = MousePosition.X;
            this.y1 = MousePosition.Y;
            this.mouse = true;
        }
        this.x2 = MousePosition.X;
        this.y2 = MousePosition.Y;
        Graphics g = this.CreateGraphics();
        Pen myPen = new Pen(this.color1.Color);
        g.DrawLine(myPen,x1,y1-26,x2,y2-26);
    }
            
    void MainFormMouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
        Graphics g = this.CreateGraphics();
        Pen myPen = new Pen(this.color1.Color);
        g.DrawLine(myPen,x1,y1-26,x2,y2-26);
    }

    Hier klickt Man auf 2 Punkte in der Form und er zeichnet eine direkte Linie.

    Weiß jemand wie Ich den code ändern muss, dass das oben genannte geht?


    MfG Alexander12
     

  7. #22
    Avatar von Alexander Schuc
    Alexander Schuc Alexander Schuc ist offline admin | crazy-weasel
    tutorials.de Administrator
    Registriert seit
    Aug 2001
    Ort
    Österreich, Stmk, Graz
    Beiträge
    2.783
    Hallo.

    Das du das Paint-Event benutzen sollst hab ich dir schon gesagt, oder?

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    
    private Line current;
    private List<Line> lines = new List<Line>();
     
    private void DrawPanel_Paint(object sender, PaintEventArgs e)
    {
        foreach (Line l in lines)
        {
            e.Graphics.DrawLine(Pens.Blue, l.Start, l.End);
        }
     
        if (current != null)
            e.Graphics.DrawLine(Pens.Red, current.Start, current.End);
    }
     
    private void DrawPanel_MouseDown(object sender, MouseEventArgs e)
    {
        if (current == null)
            current = new Line();
     
        current.Start = new Point(e.X, e.Y);
        current.End = current.Start;
    }
     
    private void DrawPanel_MouseUp(object sender, MouseEventArgs e)
    {
        current.End = new Point(e.X, e.Y);
        lines.Add(current);
        current = null;
     
        DrawPanel.Invalidate();
    }
     
    private void DrawPanel_MouseMove(object sender, MouseEventArgs e)
    {
        if (current != null)
        {
            current.End = new Point(e.X, e.Y);
     
            DrawPanel.Invalidate();
        }
    }

    Line sieht der Einfachheit wegen nur mal so aus.
    Code :
    1
    2
    3
    4
    5
    
    public class Line
    {
        public Point Start;
        public Point End;
    }

    Für .net 1.x statt der Liste einfach halt nen ArrayList nehmen.


    MfG,
    Alex
     
    With the first link the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably.
    Aaron Satie

    Legends... are the spice of the universe, Mr. Data, because they have a way of sometimes coming true.
    Captain Jean-Luc Picard, Stardate ~41294.5

    Tutorials.de chattet. Hier gibts auch .net Support ^^
    Klickt auf chattet und nutzt den Webchat, oder verbindet euch zu irc.tutorials.de - Channel #Tutorials.de

    (moo)blog furred.net // SiteInfo für WP7 // Pastebin für WP7 // BlogEngine.net Extensions

  8. #23
    Avatar von Alexander12
    Alexander12 Alexander12 ist offline Mitglied Smaragd
    Registriert seit
    Jul 2005
    Ort
    Tutorials.de
    Beiträge
    1.143
    Hi.

    Wow, Danke!
    Echt super, funktioniert.


    MfG Alexander12
     

Ähnliche Themen

  1. Dynamics Frage / allg. Frage
    Von dixone im Forum Cinema 4D
    Antworten: 7
    Letzter Beitrag: 01.09.10, 23:00
  2. Frage-Antwort-Frage Spiel...
    Von Vitus im Forum Fun-Forum
    Antworten: 15
    Letzter Beitrag: 26.08.08, 20:14
  3. ma ne frage:P
    Von backfisch123456 im Forum XML Technologien
    Antworten: 5
    Letzter Beitrag: 27.06.06, 01:50
  4. [Frage:] Frage zu Passgen
    Von Liftboy im Forum PHP
    Antworten: 6
    Letzter Beitrag: 04.08.05, 19:03
  5. Antworten: 5
    Letzter Beitrag: 01.04.05, 13:00