Durch PictureBox loopen

  • VB.NET
  • .NET (FX) 4.0

Es gibt 2 Antworten in diesem Thema. Der letzte Beitrag () ist von xXxcodemasterxXx.

    Durch PictureBox loopen

    Hallo!

    Ich versuche durch eine picturebox zu loopen und mit einer farbe abzugleichen. Ich brauche die Koordinaten der Farben.
    Mein Code:

    VB.NET-Quellcode

    1. For x As Integer = 1 To PictureBox1.Size.Width - 1
    2. For y As Integer = 1 To PictureBox1.Size.Height - 1
    3. Dim color As Color = CType(PictureBox1.Image, Bitmap).GetPixel(x, y)
    4. If color = color.Black Then
    5. Label1.Text = Label1.Text & " " & x & ";" & y & " -"
    6. End If
    7. Next
    8. Next


    Es ist wirklich wichtig! :/
    Danke schon im voraus. :D

    VB.NET-Quellcode

    1. For x As Integer = 1 To PictureBox1.Size.Width - 1
    2. For y As Integer = 1 To PictureBox1.Size.Height - 1
    3. Dim col As Color = CType(PictureBox1.Image, Bitmap).GetPixel(x, y)
    4. If col = Color.FromArgb(0, 0, 0) Then
    5. MessageBox.Show(String.Format("{0} ; {1}", x, y))
    6. End If
    7. Next
    8. Next


    So geht es. Aus irgendeinem Grund funktioniert das über die einzelnen Color Propertys nicht

    8-) faxe1008 8-)