Picturebox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    Picturebox

    HEllo.
    How can I draw a point on the picturebox.
    Thanks.


  • Morpheus

    #2
    Re: Picturebox

    I'm sure that picture1.Line(5 ,5)-(5,5) draws a point (or more precisely a
    line of one point)

    I don't remember if you can use PSet also for pictureboxes, in this way:

    picture1.PSet(5 ,5)

    assuming that picture1 is the name of the picturebox and 5,5 are the
    coordinates of the point to draw

    Bye



    "David" <dvd@post.sk> ha scritto nel messaggio
    news:u2oM6CAOEH A.904@TK2MSFTNG P12.phx.gbl...[color=blue]
    > HEllo.
    > How can I draw a point on the picturebox.
    > Thanks.
    >
    >[/color]


    Comment

    • Morpheus

      #3
      Re: Picturebox

      Sorry, I was thinking in VB6...

      In fact this is an interesting question, because in the Graphics class of
      the framework I don't see a 'DrawPoint' method.

      If I find a solution, I will post in the newsgroup.

      Bye

      "David" <dvd@post.sk> ha scritto nel messaggio
      news:u2oM6CAOEH A.904@TK2MSFTNG P12.phx.gbl...[color=blue]
      > HEllo.
      > How can I draw a point on the picturebox.
      > Thanks.
      >
      >[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Picturebox

        David schrieb:[color=blue]
        > How can I draw a point on the picturebox.[/color]

        \\\
        Private Sub Form1_Paint( _
        ByVal sender As Object, _
        ByVal e As System.Windows. Forms.PaintEven tArgs _
        ) Handles MyBase.Paint
        e.Graphics.Fill Rectangle( _
        Brushes.Red, _
        New Rectangle(100, 100, 1, 1) _
        )
        End Sub
        ///

        --
        Herfried K. Wagner [MVP]
        <URL:http://dotnet.mvps.org/>

        Comment

        • Ken Tucker [MVP]

          #5
          Re: Picturebox

          Hi,

          Draw a line with the same start and end points.

          Dim g As Graphics = PictureBox1.Cre ateGraphics
          g.DrawLine(Pens .Black, 10, 10, 10, 10)

          Ken
          ----------------
          "David" <dvd@post.sk> wrote in message
          news:u2oM6CAOEH A.904@TK2MSFTNG P12.phx.gbl...[color=blue]
          > HEllo.
          > How can I draw a point on the picturebox.
          > Thanks.
          >
          >[/color]


          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: Picturebox

            Ken,

            Ken Tucker [MVP] schrieb:[color=blue]
            > Draw a line with the same start and end points.
            >
            > Dim g As Graphics = PictureBox1.Cre ateGraphics
            > g.DrawLine(Pens .Black, 10, 10, 10, 10)[/color]

            I am not sure if I am right, but I remember that this filled 2 pixels
            instead of one. Did you test it?

            --
            Herfried K. Wagner [MVP]
            <URL:http://dotnet.mvps.org/>

            Comment

            • Armin Zingler

              #7
              Re: Picturebox

              "David" <dvd@post.sk> schrieb im Newsbeitrag
              news:u2oM6CAOEH A.904@TK2MSFTNG P12.phx.gbl...[color=blue]
              > HEllo.
              > How can I draw a point on the picturebox.
              > Thanks.[/color]

              Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.



              --
              Armin

              How to quote and why:



              Comment

              • Jay B. Harlow [MVP - Outlook]

                #8
                Re: Picturebox

                David,
                In addition to the others comments.

                Be mindful of drawing on PictureBoxes as Picture Boxes are more for
                displaying pictures...



                Hope this helps
                Jay

                "David" <dvd@post.sk> wrote in message
                news:u2oM6CAOEH A.904@TK2MSFTNG P12.phx.gbl...[color=blue]
                > HEllo.
                > How can I draw a point on the picturebox.
                > Thanks.
                >
                >[/color]


                Comment

                • Ken Tucker [MVP]

                  #9
                  Re: Picturebox

                  Hi,

                  Yes. The both are almost impossible to see.



                  Ken
                  -----------
                  "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                  news:exwFVUBOEH A.1392@TK2MSFTN GP09.phx.gbl...[color=blue]
                  > Ken,
                  >
                  > Ken Tucker [MVP] schrieb:[color=green]
                  >> Draw a line with the same start and end points.
                  >>
                  >> Dim g As Graphics = PictureBox1.Cre ateGraphics
                  >> g.DrawLine(Pens .Black, 10, 10, 10, 10)[/color]
                  >
                  > I am not sure if I am right, but I remember that this filled 2 pixels
                  > instead of one. Did you test it?
                  >
                  > --
                  > Herfried K. Wagner [MVP]
                  > <URL:http://dotnet.mvps.org/>[/color]


                  Comment

                  Working...