Displaying 3 results from an estimated 3 matches for "black_brush".
2007 Dec 30
4
Drawing thread not getting enough time from scheduler?
...drawing.
window = Wx::Window.new(frame, :size => [300, 300])
#Animate.
thread = Thread.new do
300.times do |i|
#Clear screen.
buffer.draw do |surface|
surface.pen = Wx::Pen.new(Wx::Colour.new(0, 0, 0), 0)
surface.brush = Wx::BLACK_BRUSH
surface.draw_rectangle(0, 0, 300, 300)
end
#Draw lines.
30.times do |j|
x = i + j
buffer.draw do |surface|
surface.pen = Wx::Pen.new(
Wx::Colour.new(128, 255, 128),
3
)...
2008 Jan 19
5
No joy from Wx::App.dispatch, Wx::App.yield...
...end
t.start(33)
end
def animate(window, buffer)
green_pen = Wx::Pen.new(Wx::Colour.new(128, 255, 128), 3)
black_pen = Wx::Pen.new(Wx::Colour.new(0, 0, 0), 0)
buffer.draw do |surface|
#Clear screen.
surface.pen = black_pen
surface.brush = Wx::BLACK_BRUSH
surface.draw_rectangle(0, 0, 300, 300)
#Draw lines.
surface.pen = green_pen
surface.pen.cap = Wx::CAP_ROUND
30000.times do |j|
x = @i + j
surface.draw_line(x, 0, x+100, 100)
end
end
#Update screen.
update_window(w...
2007 Dec 01
5
Tearing in my buffered animation test script...
...w.
buffer.draw do |buffer_dc|
dc.blit(0, 0, 300, 300, buffer_dc, 0, 0)
end
end
end
#Animate.
(1..40).each do |i|
#Clear screen.
buffer.draw do |surface|
surface.pen = Wx::Pen.new(Wx::Colour.new(0, 0, 0), 0)
surface.brush = Wx::BLACK_BRUSH
surface.draw_rectangle(0, 0, 300, 300)
end
#Draw line.
buffer.draw do |surface|
surface.pen = Wx::Pen.new(
Wx::Colour.new(128, 255, 128),
3
)
surface.pen.cap = Wx::CAP_ROUND
surface.draw_line(i, 0, i+100, 100)
end...