pixel erase help
ratronic
Posts: 1,451
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Ratcliff· N6YEE
Post Edited (ratronic) : 7/14/2007 11:11:45 PM GMT
·· 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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
D RatFix it if ain't broke·
Dave Ratcliff· N6YEE
Post Edited (ratronic) : 7/14/2007 11:11:45 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax Forums - If you're ready to learn, we're ready to help.
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..... :-(
P.S. This is probably such a simple question I should know the anwser to, but I don't!!!!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
Dave Ratcliff· N6YEE
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)
@ratronic: Your question still confuses me - what is wrong with my first answer?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
Dave Ratcliff· N6YEE
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.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
Dave Ratcliff· N6YEE