Imagebox Pixel Farbe

  • VB.NET

Es gibt 7 Antworten in diesem Thema. Der letzte Beitrag () ist von Zim.

    Den Farbwert von Pixel auslesen? Hab ich zwar noch nie gemacht, aber Google hat mir was interessantes und verständliches ausgepuckt.
    So kriegst du den Farbwert des ausgewählten Pixel:

    vbarchiv.net/tipps/tipp_1727-d…ner-picturebox-vbnet.html

    Mfg Dancger
    MESS WITH THE BEST, DIE LIKE THE REST! :evil:
    n'paar Links: DNS Tools, Steal WA DB, Droidsheep...
    Hä iwie hab ich nen Brett form kopp
    Ich rall das nu iwie nicht wie ich dem das gezeichnete übergeben muss damit der mir nicht immer ein Schwarzes Bild speichert.

    Ich hab da ne Picturebox1, da zeichne ich etwas rein. Und dann will ich das als Bild speichern damit ich mit diesem GetPixel weiter machen kann...

    Das male ich darein und will das dann speichern.

    VB.NET-Quellcode

    1. Public Sub Kurve()
    2. G = Form1.PictureBox1.CreateGraphics
    3. G.Clear(Form1.PictureBox1.BackColor)
    4. G.FillRectangle(Brushes.Silver, Form1.ClientRectangle)
    5. If Form1.CheckBox1.Checked() = True Then
    6. G.SmoothingMode = Drawing.Drawing2D.SmoothingMode.HighQuality
    7. Else
    8. G.SmoothingMode = Drawing.Drawing2D.SmoothingMode.None
    9. End If
    10. Dim peon As New Pen(Brushes.Black, 1)
    11. G.DrawRectangle(peon, 0, 0, Form1.PictureBox1.Size.Width - 1, Form1.PictureBox1.Size.Height - 1)
    12. For i = 0 To Form1.PictureBox1.Size.Height - 60 Step 40
    13. G.DrawRectangle(peon, 40, 20 + i, Form1.PictureBox1.Size.Width - 1, 20)
    14. Next
    15. For i = 0 To Form1.PictureBox1.Size.Width Step 40
    16. G.DrawRectangle(peon, 40 + i, 0, 40 + i, Form1.PictureBox1.Size.Height - 43)
    17. Next
    18. Werte(0) = New Point(CInt(((Form1.PictureBox1.Size.Width - 40) / 5) * 0 + 40), Form1.PictureBox1.Height - CInt(Form1.NumericUpDown1.Value) - 43)
    19. Werte(1) = New Point(CInt(((Form1.PictureBox1.Size.Width - 40) / 5) * 1 + 40), Form1.PictureBox1.Height - CInt(Form1.NumericUpDown2.Value) - 43)
    20. Werte(2) = New Point(CInt(((Form1.PictureBox1.Size.Width - 40) / 5) * 2 + 40), Form1.PictureBox1.Height - CInt(Form1.NumericUpDown3.Value) - 43)
    21. Werte(3) = New Point(CInt(((Form1.PictureBox1.Size.Width - 40) / 5) * 3 + 40), Form1.PictureBox1.Height - CInt(Form1.NumericUpDown4.Value) - 43)
    22. Werte(4) = New Point(CInt(((Form1.PictureBox1.Size.Width - 40) / 5) * 4 + 40), Form1.PictureBox1.Height - CInt(Form1.NumericUpDown5.Value) - 43)
    23. Werte(5) = New Point(CInt(((Form1.PictureBox1.Size.Width - 40) / 5) * 5 + 40), Form1.PictureBox1.Height - CInt(Form1.NumericUpDown6.Value) - 43)
    24. G.DrawCurve(Pens.Blue, Werte, CSng(Form1.TextBox1.Text))
    25. End Sub


    [Edit]: So hab das nu doch hinbekommen.
    Aber ich kann immer nur einmal speichern ... Also kann ich auch immer nur einmal Zeichnen ?(

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Zim“ ()