Fox wrote:
> Considering the efficiency. In this case, which widget should I draw on?
> Fl_Box, Fl_Window or others?
Fl_Box would be a good choice.
> How can I erase the image step by step, not erase all of it?
Just draw a big filled rectangle of the same color over the area
you want to erase, and draw your new data into that area.
> Which function should I use?
Set colors with fl_color(), plot points with fl_point(),
draw lines with fl_line(), and for filled rectangles use fl_rectf().
If speed of update is essential, and simulating a real scope's
artifacts is secondary or not needed, consider just drawing
using fl_point/fl_line, and use fl_rectf() to erase.
If you're trying to go all out and replicate things like phosphor
diffusion, antialiased lines, phosphor burn and fade, and speed
is secondary to that, consider drawing into your own ram buffer
and slapping the ram buffer to the screen using fl_draw_image().
Example: http://seriss.com/people/erco/fltk/#FlDrawImage
With this you could just plot points wherever you want, and have
a separate routine that passes over the entire image every 1/10th
of a second (using a timer) that halves all the green pixel values,
simulating a phosphor scope's 'fade'.
Most modern machines should be fast enough for this. And if you're
only plotting green, then you'd only have to fade the green channel,
so you don't have to spend time considering red + blue pixels.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk