It doesn't seem to be documented (nor is it particularly advanced),
but I had some luck with simple image drawing by looking into the
images.processing vocab:
https://github.com/slavapestov/factor/blob/master/basis/images/processing/processing.factor

For example, try the following in the UI listener:

    USING: images.processing images.viewer ;
    {
        { 1 1 1 1 1 }
        { 1 0 1 0 1 }
        { 1 1 1 1 1 }
        { 0 1 1 1 0 }
        { 0 0 0 0 0 }
        { 1 1 1 1 1 }
    } flip 10 matrix-zoom matrix>image image.

For loading/saving images, see the images.loader vocab:
http://docs.factorcode.org/content/vocab-images.loader.html

There could very well be better libraries that I'm simply unaware of.
It might help to peruse
http://docs.factorcode.org/content/vocab-images.html

The UI vocabs also come to mind:
http://docs.factorcode.org/content/vocab-ui.html  Not sure if they'll
be of much help here, though.  But an example of a polygon in the UI
anyway:

    USING: colors.constants ui.pens.polygon ui.gadgets.panes ;
    "black" named-color { { 0 0 } { 100 100 } { 200 0 } }
<polygon-gadget> gadget.

Hope that's enough to get you started (or at least until someone with
a better answer comes along),
--Alex Vondrak

On Sun, Oct 13, 2013 at 10:43 PM, Alf Mikula <[email protected]> wrote:
> Hey everybody,
>
> I'm having a little bit of trouble getting started, and I'd appreciate any
> help that anyone can offer.
>
> I'm looking for a simple example on how to draw lines and polygons, and how
> to save the results in an image, such as a jpg or png file.
>
> Can anybody provide an example, or point me in the right direction?
>
> Thanks,
>
> -Alf
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to