vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Erstellen von dynamischen Kontextmen?s - wann immer Sie sie brauchen!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Ein- und Umsteiger
Re: Grafik rückgängig machen 
Autor: Caddy
Datum: 27.10.11 20:42

Ok soweit richtig...

hier mal folgenden Auszug aus meinem Paint Event:

 Dim p As New Pen(Brushes.Black, 3)
        Dim pl As New Pen(colors2)
        Dim chartw As Single = 1200
        Dim charth As Single = 850
        Dim chartx As Single = (PictureBox1.Width - chartw) / 2
        Dim charty As Single = (PictureBox1.Height - charth) / 2
 
        cl1 = cl
 
        Dim AnzahlDaten As Integer = ListBox1.Items.Count * 2 + 1
        Dim Balkenw As Single = chartw / AnzahlDaten
        Dim temp As Single = Runden((Math.Ceiling(max / 100)) * 100, 0)
        Dim Skalahmeasure As Single = (charth / temp) * 100
        Dim zähler As Integer = 1
 
        xcor(0) = chartx + Balkenw / 2
 
        For t As Integer = 0 To temp / 100
            'Mittellinien
            Dim p1 As New Point
            Dim p2 As New Point
 
            p1.X = chartx + Balkenw / 2
            p1.Y = charty + charth - (t * Skalahmeasure)
            p2.X = chartx + chartw - Balkenw / 2
            p2.Y = charty + charth - (t * Skalahmeasure)
            pl.DashStyle = Drawing2D.DashStyle.Dash
            e.Graphics.DrawLine(pl, p1, p2)
            If t Mod 2 = 0 Then
                e.Graphics.DrawString(CStr(t * 100), getSFont(-2), _
                  Brushes.Black, p1.X - 50, p1.Y - 5)
            Else
                e.Graphics.DrawString(CStr(t * 100), getSFont(-2), _
                  Brushes.Black, p2.X + 20, p1.Y - 5)
            End If
 
        Next
 
            'Linksbalken
            e.Graphics.DrawLine(p, CInt(chartx) + Balkenw / 2, CInt(charty), _
              CInt(chartx) + Balkenw / 2, CInt(charty + charth))
            'Oberbalken
            e.Graphics.DrawLine(p, CInt(chartx) + Balkenw / 2, CInt(charty), _
              CInt(chartx + chartw) - Balkenw / 2, CInt(charty))
            'Unterbalken
            e.Graphics.DrawLine(p, CInt(chartx) + Balkenw / 2, CInt(charty + _
              charth), CInt(chartx + chartw) - Balkenw / 2, CInt(charty + _
              charth))
            'Rechtsbalken
            e.Graphics.DrawLine(p, CInt(chartx + chartw) - Balkenw / 2, CInt( _
              charty), CInt(chartx + chartw) - Balkenw / 2, CInt(charty + _
              charth))
 
            For t As Integer = 0 To ListBox1.Items.Count - 1
 
                Dim Balkenx As Single = chartx + (Balkenw * zähler)
                Dim Balkenh As Single = (winkellist(t) * Skalahmeasure) / 100
                Dim Balkeny As Single = charty + charth - Balkenh
                Dim br As New SolidBrush(cl(t))
 
 
                Dim MyStringFormat As New System.Drawing.StringFormat
                MyStringFormat.FormatFlags = _
                  StringFormatFlags.DirectionRightToLeft
 
                If (t + 1) Mod 2 = 0 Then
                    e.Graphics.DrawString(t + 1, getSFont(-2), Brushes.Black, _
                      Balkenx + (Balkenw / 2) + (MeasureString(Me, t + 1, _
                      getSFont(-2)) / 2), charty - 15, MyStringFormat)
                Else
 
                    e.Graphics.DrawString(t + 1, getSFont(-2), Brushes.Black, _
                      Balkenx + (Balkenw / 2) + (MeasureString(Me, t + 1, _
                      getSFont(-2)) / 2), charty + charth + 5, MyStringFormat)
                End If
 
                e.Graphics.DrawString(winkellist(t), getSFont(-2), br, Balkenx _
                  + (Balkenw / 2) + (MeasureString(Me, winkellist(t), getSFont( _
                  -2)) / 2), charty + charth - Balkenh - 15, MyStringFormat)
 
                'Balken
 
                e.Graphics.FillRectangle(br, Balkenx, Balkeny, Balkenw, Balkenh)
                e.Graphics.DrawRectangle(Pens.Black, Balkenx, Balkeny, Balkenw, _
                  Balkenh)
                Dim pline As New Point
                Dim pline1 As New Point
                pline.X = Balkenx + Balkenw * 1.5
                pline.Y = charty
                pline1.X = pline.X
                pline1.Y = charty + charth
                xcor(t + 1) = pline.X
 
 
                pl.DashStyle = Drawing2D.DashStyle.DashDotDot
                e.Graphics.DrawLine(pl, pline, pline1)
 
                zähler += 2
            Next
            ycor(0) = charty
            ycor(1) = charty + charth

Gruss Caddy

alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Grafik rückgängig machen2.487Caddy26.10.11 23:27
Re: Grafik rückgängig machen1.855Manfred X27.10.11 07:51
Re: Grafik rückgängig machen1.801Kalli27.10.11 08:30
Re: Grafik rückgängig machen1.821Caddy27.10.11 13:45
Re: Grafik rückgängig machen1.843Manfred X27.10.11 14:20
Re: Grafik rückgängig machen1.793Caddy27.10.11 14:37
Re: Grafik rückgängig machen2.262Manfred X27.10.11 14:58
Re: Grafik rückgängig machen1.752Caddy27.10.11 20:59
Re: Grafik rückgängig machen1.807bauer27.10.11 15:34
Re: Grafik rückgängig machen1.832Caddy27.10.11 20:42
Re: Grafik rückgängig machen1.767ModeratorFZelle28.10.11 11:03
Re: Grafik rückgängig machen1.856Caddy29.10.11 03:16
Re: Grafik rückgängig machen1.792ModeratorFZelle29.10.11 10:51
Re: Grafik rückgängig machen1.815Caddy27.10.11 20:43
Re: Grafik rückgängig machen1.775Manfred X27.10.11 20:57
Re: Grafik rückgängig machen1.776Caddy27.10.11 21:06

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel