I made a new version of my ifs fractal maker that uses a single modified image instead of a bunch of images. Much nicer!

http://the-shoebox.org/apps/147


On Apr 6, 2009, at 5:09 PM, Abhijit Hoskeri wrote:

On Thu, Apr 02, 2009 at 10:19:02AM -0400, Edward Heil wrote:
I made an application which draws a Sierpinski triangle.  It is
constantly drawing pixels on the screen.

I use rectangles with a height and width of 1 for those pixels.

I draw them a large number (hundreds) at a time, inside image blocks, so
it isn't adding an object for every pixel, it's adding an image for
every hundred or thousand pixels.

But it'd still be nice to modify an existing Image by adding more pixels
to it, instead of adding a bunch of new images.

You can draw on images by calling drawing functions on your image
objects. A simple example that draws whereever the mouse goes:

Shoes.app do
        @image = image('/path/to/image.jpg')
        oldx, oldy = 0, 0
        motion do |x, y|
                print "motion called: #{x}, #{y}, #{oldx}, #{oldy}\n"
                @image.line(oldx, oldy, x, y)
                oldx, oldy = x, y
                @image.show()
        end
end

-Abhijit

Reply via email to