Shop OBEX P1 Docs P2 Docs Learn Events
pixel erase help — Parallax Forums

pixel erase help

ratronicratronic Posts: 1,451
edited 2007-07-16 14:21 in Propeller 1
Hi,
·· I am making a graph of the y axis of h48c chip. I have it working but I want to erase the next pixel of last
·· plot before I plot the new pixel. Can anyone help?? Attached files.·

········ Thanks Dave

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fix it if ain't broke·
D Rat


Dave Ratcliff· N6YEE

Post Edited (ratronic) : 7/14/2007 11:11:45 PM GMT

Comments

  • CJCJ Posts: 470
    edited 2007-07-15 02:39
    simply plot the old data again with the backround color

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax Forums - If you're ready to learn, we're ready to help.
  • deSilvadeSilva Posts: 2,967
    edited 2007-07-15 11:28
    ratronic said...
    ... I am making a graph of the y axis of h48c chip. I have it working but I want to erase the next pixel of last plot before I plot the new pixel.

    As this sounds a little bit confusing, maybe you just want to erase the whole screen (called "pixels" in your program)?
    This can easily be done by

    LONGFILL(@pixels, 0, tiles32)

    I highly recommend to use the GRAPHICS.SPIN object for more complex drawings; but you have to adapt it before to the VGA 512x384 mode..... :-(
  • ratronicratronic Posts: 1,451
    edited 2007-07-15 15:10
    What I'm really looking for is how to change the foreground to the background color momentarily to erase the pixel back to orginal background then change the colors back again so i can plot another pixel??? Thanks Dave
    P.S. This is probably such a simple question I should know the anwser to, but I don't!!!!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke·
    D Rat


    Dave Ratcliff· N6YEE
  • potatoheadpotatohead Posts: 10,260
    edited 2007-07-15 18:00
    Add a color variable to your plot routine.

    PRI plot(x, y, Color)

    if x => 0 and x < 512 and y => 0 and y < 384
    pixels[noparse][[/noparse]y << 4 + x >> 5] |= |< Color

    Then you can set constants like:

    Background := [noparse][[/noparse]color value as number]
    Foreground := [noparse][[/noparse]color value as number]

    plot (x,y, Background)
  • deSilvadeSilva Posts: 2,967
    edited 2007-07-15 21:18
    @potatohead: He is using a two color driver... i.e. no colors.

    @ratronic: Your question still confuses me - what is wrong with my first answer?
  • ratronicratronic Posts: 1,451
    edited 2007-07-15 21:22
    I have switched to the graphics with video but I still am having trouble trying to figure out how to change my plot color to something different while making x,y plot and to change to background color temporarily to erase then back again. I am new to using graphics whith the prop and am really confused on how to change the color back and forth midstream in a plot. And how to setup background color and foreground color in the begining?? Attached latest files.·· Thanks Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke·
    D Rat


    Dave Ratcliff· N6YEE
  • potatoheadpotatohead Posts: 10,260
    edited 2007-07-15 21:35
    Sure there are colors.

    There is the one color and the other color, thus colors. So define the constants as 1 and 0, or whatever makes sense. Essentially, the idea was to just incorporate the color change into the pixel plotter routine so it may be leveraged elsewhere. As it is right now, the setting of a pixel to visible is hard coded. This makes things tough. Soft coding that then makes the plot routine useful for more things.

    One other little routine, similar to the plot one, would then be used to fill the screen with the background color, making for a fresh canvas to plot on.

    (or, if speed is not an issue, just use the pixel plotter to plot all the pixels with a repeat loop.)
  • ratronicratronic Posts: 1,451
    edited 2007-07-16 14:21
    Thanks everyone. I am starting to get a handle on it know.·· Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke·
    D Rat


    Dave Ratcliff· N6YEE
Sign In or Register to comment.