using the Point object

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

    using the Point object


    I want to create a program that will do graphics like math functions &
    fractals & stuff. I've been browsing thru books at the bookstores.
    Apparently, the Point object replaced Pset. The books explain how to create a
    Point object, but not how to use it. I want to be able to plot individual
    pixels. I tried DrawEllipse, but that just draws circles. I reckon that I
    have to somehow use the Pen & the Point object. I don't want to draw lines. I
    want to be able to plot individual pixels, not circles or ellipses or lines
    or boxes. Do I have to create a class & use the object to plot the pixels?
    So, how do I use the Point object to plot individual pixels? Thank you. David
  • GhostInAK

    #2
    Re: using the Point object

    Hello pcnerd,

    Point does not replace PSet. Point is a coordinate, not a pixel. Two Points
    make a line-segment. 4 Points make a rectangle.. etc.

    Look at the Graphics object for drawing functions. You may have to resort
    to drawing a rectangle with a width and height of 1.

    -Boo
    [color=blue]
    > I want to create a program that will do graphics like math functions &
    > fractals & stuff. I've been browsing thru books at the bookstores.
    > Apparently, the Point object replaced Pset. The books explain how to
    > create a Point object, but not how to use it. I want to be able to
    > plot individual pixels. I tried DrawEllipse, but that just draws
    > circles. I reckon that I have to somehow use the Pen & the Point
    > object. I don't want to draw lines. I want to be able to plot
    > individual pixels, not circles or ellipses or lines or boxes. Do I
    > have to create a class & use the object to plot the pixels? So, how do
    > I use the Point object to plot individual pixels? Thank you. David
    >[/color]


    Comment

    • guy

      #3
      RE: using the Point object

      try creating a bitmap, you can then use the SetPixel method to set the colour
      of the point you want

      checkout the BitMap class in the docs

      hth

      guy

      "pcnerd" wrote:
      [color=blue]
      >
      > I want to create a program that will do graphics like math functions &
      > fractals & stuff. I've been browsing thru books at the bookstores.
      > Apparently, the Point object replaced Pset. The books explain how to create a
      > Point object, but not how to use it. I want to be able to plot individual
      > pixels. I tried DrawEllipse, but that just draws circles. I reckon that I
      > have to somehow use the Pen & the Point object. I don't want to draw lines. I
      > want to be able to plot individual pixels, not circles or ellipses or lines
      > or boxes. Do I have to create a class & use the object to plot the pixels?
      > So, how do I use the Point object to plot individual pixels? Thank you. David[/color]

      Comment

      • pcnerd

        #4
        Re: using the Point object


        I tried using DrawEllipse. It draws circles. When I set the height & width
        to one pixel, the program draws little boxes.As I previously stated , I don't
        want to draw lines or circles or boxes. I want to plot INDIVIDUAL pixels.

        Thank you.

        "GhostInAK" wrote:
        [color=blue]
        > Hello pcnerd,
        >
        > Point does not replace PSet. Point is a coordinate, not a pixel. Two Points
        > make a line-segment. 4 Points make a rectangle.. etc.
        >
        > Look at the Graphics object for drawing functions. You may have to resort
        > to drawing a rectangle with a width and height of 1.
        >
        > -Boo
        >[color=green]
        > > I want to create a program that will do graphics like math functions &
        > > fractals & stuff. I've been browsing thru books at the bookstores.
        > > Apparently, the Point object replaced Pset. The books explain how to
        > > create a Point object, but not how to use it. I want to be able to
        > > plot individual pixels. I tried DrawEllipse, but that just draws
        > > circles. I reckon that I have to somehow use the Pen & the Point
        > > object. I don't want to draw lines. I want to be able to plot
        > > individual pixels, not circles or ellipses or lines or boxes. Do I
        > > have to create a class & use the object to plot the pixels? So, how do
        > > I use the Point object to plot individual pixels? Thank you. David
        > >[/color]
        >
        >
        >[/color]

        Comment

        • pcnerd

          #5
          RE: using the Point object


          OK, can you be more specific? Is the bitmap created in the background in
          memory & then displayed? So, for example, if I wanted to display a fractal,
          the fractal would be created as a bitmap & then displayed? Is that correct?

          Thank you.
          David

          "guy" wrote:
          [color=blue]
          > try creating a bitmap, you can then use the SetPixel method to set the colour
          > of the point you want
          >
          > checkout the BitMap class in the docs
          >
          > hth
          >
          > guy
          >
          > "pcnerd" wrote:
          >[color=green]
          > >
          > > I want to create a program that will do graphics like math functions &
          > > fractals & stuff. I've been browsing thru books at the bookstores.
          > > Apparently, the Point object replaced Pset. The books explain how to create a
          > > Point object, but not how to use it. I want to be able to plot individual
          > > pixels. I tried DrawEllipse, but that just draws circles. I reckon that I
          > > have to somehow use the Pen & the Point object. I don't want to draw lines. I
          > > want to be able to plot individual pixels, not circles or ellipses or lines
          > > or boxes. Do I have to create a class & use the object to plot the pixels?
          > > So, how do I use the Point object to plot individual pixels? Thank you. David[/color][/color]

          Comment

          • guy

            #6
            RE: using the Point object

            put a picurebox on your form

            create a bitmap in code

            set the picureboxes image property to your bitmap

            so in your case instantiate a bitmap and
            use your fractal algorithm to draw on the bitmap

            look at the docs for the bitmap class

            hth

            guy

            "pcnerd" wrote:
            [color=blue]
            >
            > OK, can you be more specific? Is the bitmap created in the background in
            > memory & then displayed? So, for example, if I wanted to display a fractal,
            > the fractal would be created as a bitmap & then displayed? Is that correct?
            >
            > Thank you.
            > David
            >
            > "guy" wrote:
            >[color=green]
            > > try creating a bitmap, you can then use the SetPixel method to set the colour
            > > of the point you want
            > >
            > > checkout the BitMap class in the docs
            > >
            > > hth
            > >
            > > guy
            > >
            > > "pcnerd" wrote:
            > >[color=darkred]
            > > >
            > > > I want to create a program that will do graphics like math functions &
            > > > fractals & stuff. I've been browsing thru books at the bookstores.
            > > > Apparently, the Point object replaced Pset. The books explain how to create a
            > > > Point object, but not how to use it. I want to be able to plot individual
            > > > pixels. I tried DrawEllipse, but that just draws circles. I reckon that I
            > > > have to somehow use the Pen & the Point object. I don't want to draw lines. I
            > > > want to be able to plot individual pixels, not circles or ellipses or lines
            > > > or boxes. Do I have to create a class & use the object to plot the pixels?
            > > > So, how do I use the Point object to plot individual pixels? Thank you. David[/color][/color][/color]

            Comment

            Working...